Skip to content

Commit 48ed4eb

Browse files
Merge branch 'master' into master
2 parents 8b9b1f2 + afb1c8a commit 48ed4eb

File tree

188 files changed

+9377
-8081
lines changed

Some content is hidden

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

188 files changed

+9377
-8081
lines changed

.github/workflows/build-tests.yml

+4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ jobs:
1212
timeout-minutes: 30
1313
steps:
1414
- uses: actions/checkout@v2
15+
- name: Use Node.js 20.x
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 20.x
1519
- uses: dart-lang/setup-dart@v1
1620

1721
- name: Cache node modules

.github/workflows/test.yml

+7-4
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,10 @@ jobs:
1919
- uses: actions/checkout@v2
2020
with:
2121
fetch-depth: 0 # Required to retrieve git history of Chromatic
22-
22+
- name: Use Node.js 20.x
23+
uses: actions/setup-node@v1
24+
with:
25+
node-version: 20.x
2326
- name: Cache node modules
2427
uses: actions/cache@v2
2528
id: cache-node-modules
@@ -51,10 +54,10 @@ jobs:
5154
timeout-minutes: 30
5255
steps:
5356
- uses: actions/checkout@v2
54-
- name: Use Node.js 14.x
57+
- name: Use Node.js 20.x
5558
uses: actions/setup-node@v1
5659
with:
57-
node-version: 14.x
60+
node-version: 20.x
5861

5962
- name: Cache node modules
6063
uses: actions/cache@v2
@@ -70,7 +73,7 @@ jobs:
7073

7174
- name: run Lighthouse CI
7275
run: |
73-
npm install -g @lhci/cli@0.7.x
76+
npm install -g @lhci/cli@0.13.x
7477
lhci autorun
7578
env:
7679
LHCI_GITHUB_APP_TOKEN: ${{ secrets.LHCI_GITHUB_APP_TOKEN }}

.github/workflows/update-usaco.yml

+73
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,73 @@
1+
name: Fetch from usaco-problems
2+
on: workflow_dispatch
3+
4+
jobs:
5+
update_problems:
6+
name: Update problems
7+
runs-on: ubuntu-latest
8+
steps:
9+
- name: Checkout usaco-guide
10+
uses: actions/checkout@v2
11+
with:
12+
fetch-depth: 0
13+
- name: Use Node.js 20.x
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: 20.x
17+
- name: Checkout usaco-problems
18+
uses: actions/checkout@v2
19+
with:
20+
repository: ${{ github.repository_owner }}/usaco-problems
21+
path: usaco-problems
22+
- name: Generate a token
23+
id: generate_token
24+
uses: actions/create-github-app-token@v1
25+
with:
26+
app-id: ${{ secrets.APP_ID }}
27+
private-key: ${{ secrets.APP_PRIVATE_KEY }}
28+
owner: ${{ github.repository_owner }}
29+
- name: Checkout auto
30+
run: |
31+
export pr_number=$(gh pr list --author 'usaco-autofetch[bot]' --json number --jq '.[0].number')
32+
echo "pr_number: $pr_number"
33+
if [ -z "$pr_number" ]
34+
then
35+
git checkout -B auto
36+
git push -f origin auto
37+
else
38+
git checkout auto
39+
fi
40+
pip install pre-commit
41+
pre-commit install
42+
env:
43+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}
44+
- name: Update contest to points
45+
run: |
46+
pip install -r src/components/markdown/ProblemsList/DivisionList/scripts/requirements.txt
47+
python src/components/markdown/ProblemsList/DivisionList/scripts/update.py -s $(date +%y) -e $(date +%y)
48+
- name: Build list of problem ids
49+
run: |
50+
yarn
51+
yarn build
52+
echo 'ids.log tail:'
53+
cat -b ids.log | tail -n 10
54+
- name: Add new problems
55+
run: |
56+
npx ts-node --skipProject usaco-problems/add_problems
57+
git add .
58+
git config --global user.name usaco-autofetch[bot]
59+
git config --global user.email usaco-autofetch[bot]@users.noreply.github.com
60+
if git commit -m 'problem auto-updates'
61+
then
62+
git push origin auto
63+
if [ -z "$pr_number" ]
64+
then
65+
gh pr create --title 'Problem auto-updates' -F usaco-problems/out/report.txt
66+
else
67+
gh pr edit $pr_number -F usaco-problems/out/report.txt
68+
fi
69+
else
70+
echo 'Problems up to date!'
71+
fi
72+
env:
73+
GH_TOKEN: ${{ steps.generate_token.outputs.token }}

.gitignore

+6
Original file line numberDiff line numberDiff line change
@@ -88,3 +88,9 @@ build.css
8888
*.icloud
8989

9090
.runtimeconfig.json
91+
92+
# for problem auto-updates
93+
usaco-problems/
94+
95+
# storybook
96+
storybook-static/

.pre-commit-config.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ repos:
77
- id: check-yaml
88
- id: check-added-large-files
99
- repo: https://github.com/pre-commit/mirrors-prettier
10-
rev: v4.0.0-alpha.4
10+
rev: v4.0.0-alpha.8
1111
hooks:
1212
- id: prettier
1313
additional_dependencies:

.prettierrc

+2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
{
2+
"$schema": "http://json.schemastore.org/prettierrc",
23
"endOfLine": "lf",
34
"semi": true,
45
"singleQuote": true,
56
"tabWidth": 2,
67
"useTabs": false,
78
"trailingComma": "es5",
89
"arrowParens": "avoid",
10+
"plugins": ["prettier-plugin-organize-imports"],
911
"overrides": [
1012
{
1113
"files": "*.md",

README.md

+1-58
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,8 @@ Thank you to the following companies:
99

1010
- [Vercel](https://vercel.com/?utm_source=cp-initiative&utm_campaign=oss),
1111
hosting & continuous deployment
12+
- [Microsoft for Nonprofits](https://microsoft.com/)
1213
- [Algolia](https://algolia.com/), search functionality
13-
- [DigitalOcean](https://m.do.co/c/a07c32d07394), forum hosting
14-
- [Chromatic](https://www.chromatic.com/), visual testing
1514
- And [more](docs/Companies.md)!
1615

1716
## Documentation + Contributing
@@ -30,62 +29,6 @@ The USACO Guide is run by the
3029
Content Authors to join our team to help us improve the Guide! Learn more
3130
[here](https://docs.google.com/document/d/13QpXqdiYQwjBLnywGL1FUG7GFdh8SM_1NigIkJl-A7k/edit).
3231

33-
### Core Team
34-
35-
- Nathan Wang
36-
- Maggie Liu (Since Aug 2021)
37-
- Melody Yu (Since Aug 2021)
38-
- Andi Qu
39-
- Siyong Huang
40-
- Darren Yao
41-
- Michael Cao
42-
43-
### Content Managers
44-
45-
- Qi Wang (Since Jun 2021)
46-
- Dong Liu (Since Jun 2021)
47-
- Neo Wang (Since Aug 2021)
48-
- Kevin Sheng (Since Oct 2021)
49-
50-
### Former Core Team
51-
52-
- Benjamin Qi
53-
- Andrew Wang
54-
- Nathan Chen
55-
56-
### Current Content Authors
57-
58-
- Jesse Choe (Since Feb 2021)
59-
- Sofia Yang (Since Apr 2021)
60-
- Nathan Gong (Since Apr 2021)
61-
- Timothy Gao (Since May 2021)
62-
- Sathvik Chundru (Since May 2021)
63-
- Brad Ma (Since Jun 2021)
64-
- Albert Ye (Since Jun 2021)
65-
- Arpan Banerjee (Since Jun 2021)
66-
- Ryan Chou (Since Jul 2021)
67-
- Aadit Ambadkar (Since Aug 2021)
68-
- Dustin Miao (Since Aug 2021)
69-
- Ben Dodge (Since Aug 2021)
70-
- Jeffrey Zhang (Since Feb 2022)
71-
- Chongtian Ma (Since May 2022)
72-
- Aditya Gupta (Since Jun 2022)
73-
- Chuyang Wang (Since August 2022)
74-
- Aakash Gokhale (Since August 2022)
75-
- Paul Chen (Since August 2022)
76-
- Daniel Ge (Since June 2023)
77-
- _This could be you!
78-
[Apply here](https://docs.google.com/document/d/13QpXqdiYQwjBLnywGL1FUG7GFdh8SM_1NigIkJl-A7k/edit)._
79-
80-
### Past Content Authors
81-
82-
- Óscar Garries Urbina
83-
- Mrinall Umasudhan
84-
- Andrew Cheng
85-
- Zhixin Wang
86-
- Jeffrey Meng
87-
- Ananth Kashyap
88-
8932
## Tech Stack
9033

9134
Our front-end is built with:

content/1_General/Fast_IO.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"uniqueId": "usaco-674",
66
"name": "Robotic Cow Herd",
77
"url": "http://www.usaco.org/index.php?page=viewproblem2&cpid=674",
8-
"source": "Plat",
8+
"source": "Platinum",
99
"difficulty": "Insane",
1010
"isStarred": false,
1111
"tags": [],

content/1_General/Olympiads.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ links.
2828
<Resource
2929
source="IOI"
3030
title="Syllabus"
31-
url="https://people.ksp.sk/~misof/ioi-syllabus/"
31+
url="https://algo.sk/ioi-syllabus/"
3232
starred
3333
>
3434
topics that can and cannot appear on IOI

content/1_General/USACO_FAQs.mdx

+12-4
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,11 @@ Register for a (free) account on [usaco.org](http://www.usaco.org/), then wait u
2222
the four-day contest window starts. When the contest window begins,
2323
the USACO homepage will update with instructions on how to participate.
2424

25-
The USACO Guide is not affiliated with the USACO. If you encounter any issues
26-
with [usaco.org](http://www.usaco.org/) (e.g., trouble registering for an account),
27-
contact the USACO contest director (Brian Dean) rather than the USACO Guide.
25+
### Q: I'm not receiving an email after registering on [usaco.org](http://www.usaco.org/) with my gmail account. Who do I ask for help?
26+
27+
This is a known issue. If you encounter any technical issues with [usaco.org](http://www.usaco.org/), contact the USACO contest director ([Brian Dean](mailto:bcdean@clemson.edu)).
28+
**Do not** submit to the USACO Guide contact form; the USACO Guide is not
29+
affiliated with the USACO, so we won't be able to help you.
2830

2931
### Q: Do I need to participate in the USACO December contest before participating in the other contests?
3032

@@ -181,7 +183,13 @@ about competitive programming.
181183

182184
### Q: Why does the website give me WA when my code gives the correct answer on my own computer?
183185

184-
It's likely due to undefined behavior; see [here](/general/debugging-checklist?lang=cpp#wrong-answer-or-runtime-error) for more information.
186+
It's likely due to undefined behavior; see [this module](/general/debugging-checklist?lang=cpp#wrong-answer-or-runtime-error) for more information.
187+
188+
### Q: What's wrong with my code?
189+
190+
Please follow **all** the instructions in [this forum post](https://forum.usaco.guide/t/how-to-ask-for-help-on-a-problem/338). You can try asking on the forum,
191+
but if it's clear that you haven't followed all of the instructions, likely
192+
the only response you will receive is to follow the instructions more carefully.
185193

186194
## Q: Where can I find USACO test data and official solutions?
187195

content/2_Bronze/Complete_Rec.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
}
8484
},
8585
{
86-
"uniqueId": "ccc-Twenty-four",
86+
"uniqueId": "ccc-twenty-four",
8787
"name": "Twenty-four",
8888
"url": "https://dmoj.ca/problem/ccc08s4",
8989
"source": "CCC",

content/2_Bronze/Conclusion.problems.json

+12
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,18 @@
4040
"site": "CF"
4141
}
4242
},
43+
{
44+
"uniqueId": "cf-1914C",
45+
"name": "Quests",
46+
"url": "https://codeforces.com/problemset/problem/1914/C",
47+
"source": "CF",
48+
"difficulty": "Easy",
49+
"isStarred": false,
50+
"tags": ["Simulation"],
51+
"solutionMetadata": {
52+
"kind": "internal"
53+
}
54+
},
4355
{
4456
"uniqueId": "cf-1772D",
4557
"name": "Absolute Sorting",

content/2_Bronze/Intro_Sets.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
id: intro-sets
3-
title: Introduction to Sets & Maps
3+
title: (Optional) Introduction to Sets & Maps
44
author: Darren Yao, Benjamin Qi, Allen Li, Jesse Choe, Nathan Gong
55
description: 'Maintaining collections of distinct elements/keys with sets and maps.'
66
frequency: 2
@@ -881,7 +881,7 @@ make their implementation easier.
881881

882882
</Quiz.Question>
883883
<Quiz.Question>
884-
What is the time complexity of insertions, deletions, and searches in an unordered map of size $N$?
884+
What's the average time complexity of a uniformly random sequence of insertions, deletions, and searches in an unordered map of size $N$?
885885
<Quiz.Answer correct>
886886
$\mathcal{O}(1)$
887887
<Quiz.Explanation>

content/3_Silver/Binary_Search.mdx

+4-5
Original file line numberDiff line numberDiff line change
@@ -1198,27 +1198,26 @@ def binary_search(x: int, a: list):
11981198
</PySection>
11991199
</LanguageSection>
12001200
1201-
12021201
<Quiz.Answer>
1203-
$\mathcal{O}(\log n)$ / $\Omega(\log n)$
1202+
$\Theta(\log n)$ / $\Theta(\log n)$
12041203
<Quiz.Explanation>
12051204
Incorrect. Consider the case where the target element is the median of the array.
12061205
</Quiz.Explanation>
12071206
</Quiz.Answer>
12081207
<Quiz.Answer correct>
1209-
$\mathcal{O}(\log n)$ / $\Omega(1)$
1208+
$\Theta(\log n)$ / $\Theta(1)$
12101209
<Quiz.Explanation>
12111210
Correct. The worst case happens when the number is not present, and the best case occurs if the first number we check is the target value.
12121211
</Quiz.Explanation>
12131212
</Quiz.Answer>
12141213
<Quiz.Answer>
1215-
$\mathcal{O}(n)$ / $\Omega(\log n)$
1214+
$\Theta(n)$ / $\Theta(\log n)$
12161215
<Quiz.Explanation>
12171216
Incorrect. Binary search always takes at most $\lceil \log n \rceil$ iterations.
12181217
</Quiz.Explanation>
12191218
</Quiz.Answer>
12201219
<Quiz.Answer>
1221-
$\mathcal{O}(\log n)$ / $\Omega(\log \log n)$
1220+
$\Theta(\log n)$ / $\Theta(\log \log n)$
12221221
<Quiz.Explanation>
12231222
Incorrect. Consider the case where the target element is the median of the array.
12241223
</Quiz.Explanation>

content/3_Silver/Binary_Search.problems.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@
105105
"uniqueId": "usaco-624",
106106
"name": "Load Balancing",
107107
"url": "http://www.usaco.org/index.php?page=viewproblem2&cpid=624",
108-
"source": "Plat",
108+
"source": "Platinum",
109109
"difficulty": "Insane",
110110
"isStarred": false,
111111
"tags": ["Binary Search", "Sorting"],

0 commit comments

Comments
 (0)