Skip to content

Commit b376e22

Browse files
authored
Merge branch 'master' into master
2 parents 3593c6b + 5823f52 commit b376e22

File tree

174 files changed

+2350
-1079
lines changed

Some content is hidden

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

174 files changed

+2350
-1079
lines changed

.github/workflows/update-usaco.yml

+8-1
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,15 @@ jobs:
2626
app-id: ${{ secrets.APP_ID }}
2727
private-key: ${{ secrets.APP_PRIVATE_KEY }}
2828
owner: ${{ github.repository_owner }}
29-
- name: Checkout auto
29+
- name: Get PR number
3030
run: |
3131
export pr_number=$(gh pr list --author 'usaco-autofetch[bot]' --json number --jq '.[0].number')
32+
echo "pr_number: $pr_number"
33+
echo "pr_number=$pr_number" >> "$GITHUB_ENV"
34+
env:
35+
GH_TOKEN: ${{ github.token }}
36+
- name: Checkout auto
37+
run: |
3238
echo "pr_number: $pr_number"
3339
if [ -z "$pr_number" ]
3440
then
@@ -58,6 +64,7 @@ jobs:
5864
bash .git/hooks/pre-commit || git add .
5965
git config --global user.name usaco-autofetch[bot]
6066
git config --global user.email usaco-autofetch[bot]@users.noreply.github.com
67+
echo "pr_number: $pr_number"
6168
if git commit -m 'problem auto-updates'
6269
then
6370
git push origin auto

content/1_General/Contributing.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ is useful if you need to use Tailwind CSS classes, which don't work with
4545
- Install [node.js](https://nodejs.org/en/)
4646
- [Gatsby docs](https://www.gatsbyjs.org/tutorial/part-zero/#install-nodejs-for-your-appropriate-operating-system)
4747
- Install [yarn](https://classic.yarnpkg.com/en/)
48-
- `npm install -g yarn`? might work
48+
- `npm install -g yarn`
4949
2. Clone repo
5050
- Via command line:
5151
`git clone https://github.com/cpinitiative/usaco-guide.git`

content/1_General/Intro_CP.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
"source": "Kattis",
99
"difficulty": "Very Easy",
1010
"isStarred": false,
11-
"tags": null,
11+
"tags": [],
1212
"solutionMetadata": {
1313
"kind": "none"
1414
}

content/1_General/Olympiads.mdx

+17-1
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,22 @@ links.
8888
- [oj.uz](https://oj.uz/problems/source)
8989
- All problems from 2014-2019.
9090

91+
### [Romanian NOI](https://sepi.ro/) (Romanian)
92+
93+
- [Kilonova](https://kilonova.ro/problem_lists/524)
94+
- Every national olympiad problem from 2002 onwards.
95+
- [Kilonova](https://kilonova.ro/problem_lists/225)
96+
- Every Romanian IOI TST problem from early 2000s onwards.
97+
- [Kilonova](https://kilonova.ro/problem_lists/689)
98+
- Every Romanian EJOI/JBOI junior TST problem from 2008 onwards.
99+
100+
### [IIOT](https://iio.team/)
101+
102+
- [Kilonova](https://kilonova.ro/problem_lists/128)
103+
- Most Romanian problems from 2019 onwards.
104+
- [olinfo.it](https://training.olinfo.it/#/tasks/1?tag=ois)
105+
- Most Italian problems from 2016 onwards.
106+
91107
<!--
92108
<Warning>
93109

@@ -114,7 +130,7 @@ Solutions from POI problems are unfortunately only available in Polish.
114130
### Other
115131

116132
- [Italy](https://training.olinfo.it/#/overview)
117-
- [International Informatics Olympiad in Teams](http://ioit.altervista.org/2018-teams-and-contests-.html)
133+
- [International Informatics Olympiad in Teams](https://iio.team/)
118134
- [Balkan Olympiad in Informatics](https://boi2019.epy.gr/)
119135
- [InfO(1) Cup](http://info1cup.com/)
120136

content/3_Silver/Binary_Search.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -334,7 +334,7 @@
334334
"source": "Baltic OI",
335335
"difficulty": "Very Hard",
336336
"isStarred": false,
337-
"tags": ["Binary Search"],
337+
"tags": ["Binary Search", "Stack"],
338338
"solutionMetadata": {
339339
"kind": "internal"
340340
}

content/3_Silver/Func_Graphs.mdx

+1-3
Original file line numberDiff line numberDiff line change
@@ -602,9 +602,7 @@ public class Badge {
602602
if (ans[i] == -1) { floyd(i); }
603603
}
604604

605-
for (int i = 0; i < n; i++) {
606-
cout << (ans[i] + 1) << " \n"[i == n - 1];
607-
}
605+
for (int i = 0; i < n; i++) { System.out.print(ans[i] + 1 + " "); }
608606
}
609607

610608
private static void floyd(int x) {

content/3_Silver/Func_Graphs.problems.json

+13
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,19 @@
6666
"solutionMetadata": {
6767
"kind": "internal"
6868
}
69+
},
70+
{
71+
"uniqueId": "usaco-284",
72+
"name": "Luxury River Cruise",
73+
"url": "http://usaco.org/index.php?page=viewproblem2&cpid=284",
74+
"source": "Old Silver",
75+
"difficulty": "Normal",
76+
"isStarred": false,
77+
"tags": ["Functional Graph"],
78+
"solutionMetadata": {
79+
"kind": "USACO",
80+
"usacoId": "284"
81+
}
6982
}
7083
]
7184
}

content/3_Silver/More_Prefix_Sums.mdx

+5-4
Original file line numberDiff line numberDiff line change
@@ -20,16 +20,16 @@ frequency: 2
2020
### Solution - Max Subarray Sum
2121

2222
Consider the prefix sum array $p$. The subarray sum $a_i \dots a_{j-1}$, where
23-
$i\leq j$ is $p[j]-p[i]$. Thus, we are looking for the maximum possible value of
24-
$p[j]-p[i]$ over $0 \leq i \leq j \leq N$.
23+
$i < j$ is $p[j]-p[i]$. Thus, we are looking for the maximum possible value of
24+
$p[j]-p[i]$ over $0 \leq i < j \leq N$.
2525

2626
For a fixed right bound $j$, the maximum subarray sum is
2727

2828
$$
29-
p[j]-\min_{i\leq j}{p[i]}
29+
p[j]-\min_{i < j}{p[i]}
3030
$$
3131

32-
Thus, we can keep a running minimum to store $\min\limits_{i\leq j}{p[i]}$ as we
32+
Thus, we can keep a running minimum to store $\min\limits_{i < j}{p[i]}$ as we
3333
iterate through $j$. This yields the maximum subarray sum for each possible
3434
right bound, and the maximum over all these values is our answer.
3535

@@ -66,6 +66,7 @@ int main() {
6666
cout << max_subarray_sum << endl;
6767
}
6868
```
69+
6970
</CPPSection>
7071
<JavaSection>
7172

content/4_Gold/Conclusion.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@
235235
"isStarred": false,
236236
"tags": ["SP"],
237237
"solutionMetadata": {
238-
"kind": "none"
238+
"kind": "internal"
239239
}
240240
}
241241
]

content/4_Gold/Divisibility.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ id: divisibility
33
redirects:
44
- /gold/divis
55
title: 'Divisibility'
6-
author: Darren Yao, Michael Cao, Andi Qu, and Kevin Sheng
6+
author: Darren Yao, Michael Cao, Andi Qu, Kevin Sheng
77
contributors: Juheon Rhee
88
prerequisites:
99
description: Using the information that one integer evenly divides another.

content/4_Gold/Divisibility.problems.json

+12
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,18 @@
3939
"kind": "internal"
4040
}
4141
},
42+
{
43+
"uniqueId": "sumdiv",
44+
"name": "SumDiv",
45+
"url": "https://kilonova.ro/problems/127",
46+
"source": "Kilonova",
47+
"difficulty": "Normal",
48+
"isStarred": true,
49+
"tags": ["Prime Factorization", "Math"],
50+
"solutionMetadata": {
51+
"kind": "internal"
52+
}
53+
},
4254
{
4355
"uniqueId": "cf-1225D",
4456
"name": "Power Products",

content/4_Gold/MST.mdx

+1
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ To review a couple of terms:
3737
url="graph/mst_kruskal_with_dsu.html"
3838
/>
3939
<Resource source="CP2" title="4.3.2 - Kruskal's" />
40+
<Resource source="alexyd88" title="Kruskal's Visualizer" url="https://alexyd88.github.io/Kruskal-Visualizer/"/>
4041
</Resources>
4142

4243
<!-- <Resource source="PAPS" title="12.4 - Kruskal's">

content/4_Gold/Stacks.problems.json

+16-4
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,18 @@
5252
"kind": "internal"
5353
}
5454
},
55+
{
56+
"uniqueId": "baltic-12-mobile",
57+
"name": "2012 - Mobile",
58+
"url": "https://oj.uz/problem/view/BOI12_mobile",
59+
"source": "Baltic OI",
60+
"difficulty": "Normal",
61+
"isStarred": false,
62+
"tags": ["Binary Search", "Stack"],
63+
"solutionMetadata": {
64+
"kind": "internal"
65+
}
66+
},
5567
{
5668
"uniqueId": "usaco-743",
5769
"name": "Modern Art 2",
@@ -164,15 +176,15 @@
164176
}
165177
},
166178
{
167-
"uniqueId": "infoarena-ssdj",
179+
"uniqueId": "kilonova-ssdj",
168180
"name": "ssdj",
169-
"url": "https://infoarena.ro/problema/ssdj",
170-
"source": "InfoArena",
181+
"url": "https://kilonova.ro/problems/1976",
182+
"source": "Kilonova",
171183
"difficulty": "Very Hard",
172184
"isStarred": false,
173185
"tags": ["Stack"],
174186
"solutionMetadata": {
175-
"kind": "none"
187+
"kind": "internal"
176188
}
177189
},
178190
{

0 commit comments

Comments
 (0)