Skip to content

Commit 2bb3ecf

Browse files
authored
Merge branch 'master' into patch-1
2 parents ce16b84 + 4754c9c commit 2bb3ecf

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+3353
-771
lines changed

.github/workflows/build-tests.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,15 @@ jobs:
1111
runs-on: ubuntu-latest
1212
timeout-minutes: 30
1313
steps:
14-
- uses: actions/checkout@v2
14+
- uses: actions/checkout@v4
1515
- name: Use Node.js 20.x
16-
uses: actions/setup-node@v1
16+
uses: actions/setup-node@v4
1717
with:
1818
node-version: 20.x
1919
- uses: dart-lang/setup-dart@v1
2020

2121
- name: Cache node modules
22-
uses: actions/cache@v2
22+
uses: actions/cache@v4
2323
id: cache-node-modules
2424
with:
2525
path: node_modules

.github/workflows/prettier.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212

1313
steps:
1414
- name: Checkout
15-
uses: actions/checkout@v2
15+
uses: actions/checkout@v4
1616
with:
1717
# Make sure the actual branch is checked out when running on pull requests
1818
ref: ${{ github.head_ref }}

.github/workflows/test.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -16,15 +16,15 @@ jobs:
1616
tests:
1717
runs-on: ubuntu-latest
1818
steps:
19-
- uses: actions/checkout@v2
19+
- uses: actions/checkout@v4
2020
with:
2121
fetch-depth: 0 # Required to retrieve git history of Chromatic
2222
- name: Use Node.js 20.x
23-
uses: actions/setup-node@v1
23+
uses: actions/setup-node@v4
2424
with:
2525
node-version: 20.x
2626
- name: Cache node modules
27-
uses: actions/cache@v2
27+
uses: actions/cache@v4
2828
id: cache-node-modules
2929
with:
3030
path: node_modules
@@ -59,14 +59,14 @@ jobs:
5959
runs-on: ubuntu-latest
6060
timeout-minutes: 30
6161
steps:
62-
- uses: actions/checkout@v2
62+
- uses: actions/checkout@v4
6363
- name: Use Node.js 20.x
6464
uses: actions/setup-node@v1
6565
with:
6666
node-version: 20.x
6767

6868
- name: Cache node modules
69-
uses: actions/cache@v2
69+
uses: actions/cache@v4
7070
id: cache-node-modules
7171
with:
7272
path: node_modules

.github/workflows/update-usaco.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- name: Checkout usaco-guide
10-
uses: actions/checkout@v2
10+
uses: actions/checkout@v4
1111
with:
1212
fetch-depth: 0
1313
- name: Use Node.js 20.x
14-
uses: actions/setup-node@v1
14+
uses: actions/setup-node@v4
1515
with:
1616
node-version: 20.x
1717
- name: Checkout usaco-problems
18-
uses: actions/checkout@v2
18+
uses: actions/checkout@v4
1919
with:
2020
repository: ${{ github.repository_owner }}/usaco-problems
2121
path: usaco-problems
@@ -47,10 +47,10 @@ jobs:
4747
pre-commit install
4848
env:
4949
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
50-
- name: Update contest to points
51-
run: |
52-
pip install -r src/components/markdown/ProblemsList/DivisionList/scripts/requirements.txt
53-
python src/components/markdown/ProblemsList/DivisionList/scripts/update.py -s $(( $(date +%y) - 1 )) -e $(date +%y)
50+
# - name: Update contest to points
51+
# run: |
52+
# pip install -r src/components/markdown/ProblemsList/DivisionList/scripts/requirements.txt
53+
# python src/components/markdown/ProblemsList/DivisionList/scripts/update.py -s $(( $(date +%y) - 1 )) -e $(date +%y)
5454
- name: Build list of problem ids
5555
run: |
5656
yarn

content/1_General/Practicing.mdx

-7
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,6 @@ need to consult the solution for some small part. If you instantly come up with
3131
the solution, a problem is likely too easy, and if you're missing multiple
3232
steps, it might be too hard.
3333

34-
[This](https://web.evanchen.cc/faq-raqs.html) and
35-
[this](https://usamo.wordpress.com/2019/01/31/math-contest-platitudes-v3/) are
36-
two blog posts by Evan Chen that I find quite insightful. They discuss such
37-
things as time management, the problem-solving process, and other tips that you
38-
may find useful. See [my FAQ](https://darrenyao.com/usacofaq/) for more
39-
information.
40-
4134
### Additional
4235

4336
<Resources>

content/1_General/Running_Code_Locally.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ If you have installed `g++` as described
267267
This is usable with
268268
[GCC](https://en.wikipedia.org/wiki/GNU_Compiler_Collection). However, Mac OS X
269269
uses [Clang](https://en.wikipedia.org/wiki/Clang) while Windows uses
270-
[Microsoft Visual C++ (MVSC)](https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B)
270+
[Microsoft Visual C++ (MSVC)](https://en.wikipedia.org/wiki/Microsoft_Visual_C%2B%2B)
271271
by default. `<bits/stdc++.h>` is **not** a standard header file, so it will not
272272
work with the latter two. This is one of the reasons why you should **not** use
273273
`<bits/stdc++.h>` outside of competitive programming.

content/2_Bronze/Complete_Rec.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -1173,6 +1173,7 @@ appear much less frequently than they once did.
11731173
11741174
```cpp
11751175
vector<int> perm(n);
1176+
iota(begin(perm), end(perm), 1);
11761177
do {
11771178
} while (next_permutation(begin(perm), end(perm)));
11781179
```

content/2_Bronze/Intro_DS.mdx

+6-6
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ zero, you have several options:
8989

9090
<Warning>
9191

92-
[`memset(arr, 0, sizeof arr)`](http://www.cplusplus.com/reference/cstring/memset/)
93-
will also zero-initialize an array. However, it's important to note that
94-
`memset` treats the value that is passed to it as an `unsigned char`. So for an
95-
array of 32-bit integers, `memset(arr, 1, sizeof arr)` will set each element to
96-
$1$, as you might expect. On the other hand, `memset(arr, -1, sizeof arr)` will
97-
set each element to $1+2^8+2^{16}+2^{24}=16843009$, not $-1$.
92+
`memset(arr, 0, sizeof arr)` will zero-initialize an array. However, it's important to note that
93+
`memset` treats the value that is passed to it as an `unsigned char`. So for an array of 32-bit integers,
94+
`memset(arr, 1, sizeof arr)` will set each **byte** to 1, resulting in each element becoming
95+
`0x01010101` (i.e. 16843009 in decimal), not 1. On the other hand,
96+
`memset(arr, -1, sizeof arr)` will set each byte to `0xFF`, which makes each element `0xFFFFFFFF`. For
97+
signed 32-bit integers, this bit pattern represents -1 (or 4294967295 if the integers are unsigned).
9898

9999
</Warning>
100100

content/3_Silver/Conclusion.problems.json

+41-4
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,7 @@
5959
"isStarred": false,
6060
"tags": ["Binary Search"],
6161
"solutionMetadata": {
62-
"kind": "autogen-label-from-site",
63-
"site": "CF"
62+
"kind": "internal"
6463
}
6564
},
6665
{
@@ -72,8 +71,7 @@
7271
"isStarred": false,
7372
"tags": ["Connected Components", "DSU"],
7473
"solutionMetadata": {
75-
"kind": "autogen-label-from-site",
76-
"site": "CF"
74+
"kind": "internal"
7775
}
7876
},
7977
{
@@ -268,6 +266,19 @@
268266
"site": "CF"
269267
}
270268
},
269+
{
270+
"uniqueId": "cf-1108E2",
271+
"name": "Array and Segments",
272+
"url": "https://codeforces.com/contest/1108/problem/E2",
273+
"source": "CF",
274+
"difficulty": "Normal",
275+
"isStarred": false,
276+
"tags": ["Sorted Set"],
277+
"solutionMetadata": {
278+
"kind": "autogen-label-from-site",
279+
"site": "CF"
280+
}
281+
},
271282
{
272283
"uniqueId": "cf-1622C",
273284
"name": "Set Or Decrease",
@@ -281,6 +292,19 @@
281292
"site": "CF"
282293
}
283294
},
295+
{
296+
"uniqueId": "cf-2021C2",
297+
"name": "Adjust The Presentation",
298+
"url": "https://codeforces.com/problemset/problem/2021/C2",
299+
"source": "CF",
300+
"difficulty": "Normal",
301+
"isStarred": false,
302+
"tags": ["Greedy"],
303+
"solutionMetadata": {
304+
"kind": "autogen-label-from-site",
305+
"site": "CF"
306+
}
307+
},
284308
{
285309
"uniqueId": "cf-700B",
286310
"name": "Connecting Universities",
@@ -357,6 +381,19 @@
357381
"site": "CF"
358382
}
359383
},
384+
{
385+
"uniqueId": "cf-2064D",
386+
"name": "Eating",
387+
"url": "https://codeforces.com/problemset/problem/2064/D",
388+
"source": "CF",
389+
"difficulty": "Hard",
390+
"isStarred": false,
391+
"tags": ["2D Prefix Sums", "Bitmasking", "DP"],
392+
"solutionMetadata": {
393+
"kind": "autogen-label-from-site",
394+
"site": "CF"
395+
}
396+
},
360397
{
361398
"uniqueId": "cf-1943C",
362399
"name": "Tree Compass",

content/3_Silver/Greedy_Sorting.problems.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -200,15 +200,15 @@
200200
}
201201
},
202202
{
203-
"uniqueId": "lc-IPO",
203+
"uniqueId": "leetcode-502",
204204
"name": "IPO",
205205
"url": "https://leetcode.com/problems/ipo",
206206
"source": "LC",
207207
"difficulty": "Normal",
208208
"isStarred": false,
209209
"tags": ["Greedy", "Sorting", "Priority Queue"],
210210
"solutionMetadata": {
211-
"kind": "none"
211+
"kind": "internal"
212212
}
213213
},
214214
{

content/3_Silver/More_Prefix_Sums.problems.json

+22-10
Original file line numberDiff line numberDiff line change
@@ -48,15 +48,15 @@
4848

4949
"difference-arrays-problemset": [
5050
{
51-
"uniqueId": "abc179_d",
52-
"name": "Leaping Tak",
53-
"url": "https://atcoder.jp/contests/abc179/tasks/abc179_d",
54-
"source": "AC",
55-
"difficulty": "Normal",
51+
"uniqueId": "cf-816B",
52+
"name": "Karen and Coffee",
53+
"url": "https://codeforces.com/contest/816/problem/B",
54+
"source": "CF",
55+
"difficulty": "Easy",
5656
"isStarred": false,
57-
"tags": ["Difference Array", "DP"],
57+
"tags": ["Difference Array"],
5858
"solutionMetadata": {
59-
"kind": "none"
59+
"kind": "internal"
6060
}
6161
},
6262
{
@@ -70,6 +70,19 @@
7070
"solutionMetadata": {
7171
"kind": "internal"
7272
}
73+
},
74+
{
75+
"uniqueId": "cf-2030D",
76+
"name": "QED's Favorite Permutation",
77+
"url": "https://codeforces.com/contest/2030/problem/D",
78+
"source": "CF",
79+
"difficulty": "Normal",
80+
"isStarred": false,
81+
"tags": ["Difference Array", "Sortings"],
82+
"solutionMetadata": {
83+
"kind": "autogen-label-from-site",
84+
"site": "CF"
85+
}
7386
}
7487
],
7588

@@ -101,15 +114,14 @@
101114
},
102115
{
103116
"uniqueId": "cf-104114N",
104-
"name": "Nusret Gokce",
117+
"name": "Nusret Gökçe",
105118
"url": "https://codeforces.com/gym/104114/problem/N",
106119
"source": "CF",
107120
"difficulty": "Normal",
108121
"isStarred": false,
109122
"tags": ["Prefix Sums"],
110123
"solutionMetadata": {
111-
"kind": "autogen-label-from-site",
112-
"site": "CF"
124+
"kind": "internal"
113125
}
114126
},
115127
{

content/3_Silver/Prefix_Sums.mdx

-7
Original file line numberDiff line numberDiff line change
@@ -313,13 +313,6 @@ for i in range(Q):
313313
314314
## Problems
315315
316-
<Warning>
317-
318-
"Haybale Stacking" isn't submittable on the USACO website;
319-
Use [this link](https://www.spoj.com/problems/HAYBALE/) to submit instead.
320-
321-
</Warning>
322-
323316
<Problems problems="cum" hideSuggestProblemButton />
324317
325318
## Quiz

content/3_Silver/Prefix_Sums.problems.json

+3-3
Original file line numberDiff line numberDiff line change
@@ -89,10 +89,10 @@
8989
}
9090
},
9191
{
92-
"uniqueId": "usaco-104",
92+
"uniqueId": "spoj-Haybale",
9393
"name": "Haybale Stacking",
94-
"url": "http://www.usaco.org/index.php?page=viewproblem2&cpid=104",
95-
"source": "Old Bronze",
94+
"url": "https://www.spoj.com/problems/HAYBALE/",
95+
"source": "SPOJ",
9696
"difficulty": "Normal",
9797
"isStarred": true,
9898
"tags": ["Prefix Sums"],

0 commit comments

Comments
 (0)