Skip to content

Commit f547d12

Browse files
committed
fix whitespace, format bronze - silver sols
1 parent 4b43cdd commit f547d12

File tree

433 files changed

+8423
-9350
lines changed

Some content is hidden

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

433 files changed

+8423
-9350
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ _If any of the below don't apply to this Pull Request, mark the checkbox as done
22

33
- [ ] I have tested my code.
44
- [ ] I have added my solution according to the steps [here](https://usaco.guide/general/adding-solution#steps).
5-
- [ ] I have followed the code conventions mentioned [here](https://usaco.guide/general/adding-solution/#code-conventions), which include the following:
5+
- [ ] I have followed the code conventions mentioned [here](https://usaco.guide/general/adding-solution/#code-conventions), which include the following:
66
- I understand that if it is clear that I have not attempted to follow these guidelines (ex. if I have not used tabs to indent), my PR will be closed.
77
- If changes are requested, I will re-request the review after making the changes.

.pre-commit-config.yaml

+8-2
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,15 @@ repos:
88
- id: check-added-large-files
99
- repo: local
1010
hooks:
11-
- id: format
12-
name: format
11+
- id: format-mdx
12+
name: format-mdx
1313
entry: python py/format_code.py
1414
language: python
1515
types: [mdx]
1616
additional_dependencies: [black-with-tabs, clang-format]
17+
- id: black-with-tabs
18+
name: black-with-tabs
19+
entry: black
20+
language: python
21+
types: [python]
22+
additional_dependencies: [black-with-tabs]

CODEOWNERS

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@
1515
/content/6_Advanced/ @dustin-miao @dongliu0426
1616
/solutions/advanced/ @dustin-miao @dongliu0426
1717
/content/extraProblems.json
18-
/content/team/ @maggie-j-liu
18+
/content/team/ @maggie-j-liu

CODE_OF_CONDUCT.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -73,4 +73,4 @@ available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.ht
7373
[homepage]: https://www.contributor-covenant.org
7474

7575
For answers to common questions about this code of conduct, see
76-
https://www.contributor-covenant.org/faq
76+
https://www.contributor-covenant.org/faq

announcements/2020 Dec.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ title: "USACO December Problems Added"
55
order: 4
66
---
77

8-
All problems from the [USACO 2020 December Contest](http://www.usaco.org/index.php?page=dec20results) have been added to the USACO problem table [here](/general/usaco-monthlies).
8+
All problems from the [USACO 2020 December Contest](http://www.usaco.org/index.php?page=dec20results) have been added to the USACO problem table [here](/general/usaco-monthlies).

announcements/2021 Jan.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ title: "USACO January Problems Added"
55
order: 4
66
---
77

8-
All problems from the [USACO 2021 January Contest](http://www.usaco.org/index.php?page=jan21results) have been added to the USACO problem table [here](/general/usaco-monthlies).
8+
All problems from the [USACO 2021 January Contest](http://www.usaco.org/index.php?page=jan21results) have been added to the USACO problem table [here](/general/usaco-monthlies).

content/1_General/Basic_Debugging.mdx

+8-8
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ submitting to an OJ.
189189
</Resource>
190190
</Resources>
191191
192-
Here's a handy macro that prints the line number (`__LINE__`) and the name of
192+
Here's a handy macro that prints the line number (`__LINE__`) and the name of
193193
the variable (`#v`) in addition to the value of the variable (`v`).
194194
195195
```cpp
@@ -281,7 +281,7 @@ prog: main.cpp:6: int main(): Assertion `false' failed.
281281
Command exited with non-zero status 134
282282
```
283283

284-
If you want to disable all asserts (say, before submitting) you can add
284+
If you want to disable all asserts (say, before submitting) you can add
285285
`#define NDEBUG` to the start of your program.
286286

287287
```cpp
@@ -298,8 +298,8 @@ int main() {
298298

299299
## Stress Testing
300300

301-
If your code is getting WA, one option is to run your buggy solution against
302-
another solution that you're relatively confident is correct on randomly
301+
If your code is getting WA, one option is to run your buggy solution against
302+
another solution that you're relatively confident is correct on randomly
303303
generated data until you find a difference. See the video for details.
304304

305305
<Resources>
@@ -365,7 +365,7 @@ same language.
365365
Another option is to write three different programs, one for the correct program,
366366
one for the incorrect program, and one for generating inputs. Then
367367
you can use the script below to find an input on which the correct and
368-
incorrect programs differ. If you want to learn how to write these scripts
368+
incorrect programs differ. If you want to learn how to write these scripts
369369
yourself, see [this module](/general/cpp-command#linux).
370370

371371
<LanguageSection>
@@ -557,7 +557,7 @@ fi
557557
</PySection>
558558
</LanguageSection>
559559

560-
In essence, a debugger is a tool to "trace code" for you. Using a debugger
560+
In essence, a debugger is a tool to "trace code" for you. Using a debugger
561561
varies from language to language and even from IDE to different
562562
IDE, so we will only go over the basics of a debugger.
563563

@@ -569,7 +569,7 @@ Pros of using a debugger:
569569

570570
Cons of using a debugger:
571571

572-
- It is not much different from just printing the values out at various points
572+
- It is not much different from just printing the values out at various points
573573
in your program.
574574
- Most competitive programmers do not use debuggers.
575575
- You cannot see the overall "output" of your program at each stage. For
@@ -589,4 +589,4 @@ be the "Step Over" button that will allow you to move to the next line. Say you
589589
are at a line with the following code: `dfs(0, -1)`, if you click "step over" the
590590
debugger will ignore showing you what happens in this function and go to the
591591
next line. If you click "step in," however, you will enter the function and be
592-
able to step through that function.
592+
able to step through that function.

content/1_General/Contests.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Let me know if there's something else I should try to qualify for!
133133
>
134134
recently updated
135135
</Resource>
136-
136+
137137
<Resource
138138
title="Carrot"
139139
url="https://chrome.google.com/webstore/detail/carrot/gakohpplicjdhhfllilcjpfildodfnnn"

content/1_General/Data_Types.mdx

+7-7
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ prerequisites:
4141

4242
<div className="overflow-x-auto">
4343

44-
| _Types_ | `int` | `long long` | `double` | `bool` | `char` |
45-
| ----------------- | ----------------------- | ----------------------- | ------------------------ | -------------------------- | ------------------ |
46-
| Description | 32-bit integer | 64-bit integer | Double-precision float | True/False value | 8-bit character |
47-
| Size (bytes) | 4 | 8 | 8 | 1 | 1 |
44+
| _Types_ | `int` | `long long` | `double` | `bool` | `char` |
45+
| ----------------- | ----------------------- | ----------------------- | ------------------------ | -------------------------- | ------------------ |
46+
| Description | 32-bit integer | 64-bit integer | Double-precision float | True/False value | 8-bit character |
47+
| Size (bytes) | 4 | 8 | 8 | 1 | 1 |
4848
| Range | $-2^{31}$ to $2^{31}-1$ | $-2^{63}$ to $2^{63}-1$ | `-1.7E+308` to `+1.7E+308` | $0$ or $1$ (`true` or `false`) | $-2^7$ to $2^7-1$ |
4949

5050
</div>
@@ -70,9 +70,9 @@ For more primitive data types, check the the first resource in the table above.
7070

7171
<div className="overflow-x-auto">
7272

73-
| _Types_ | `int` | `long` | `double` | `boolean` | `char` |
74-
| ------------ | ----------------------- | ----------------------- | -------------------------- | ------------------ | ------------------------ |
75-
| Description | 32-bit integer | 64-bit integer | Double-precision float | True/False value | 16-bit Unicode character |
73+
| _Types_ | `int` | `long` | `double` | `boolean` | `char` |
74+
| ------------ | ----------------------- | ----------------------- | -------------------------- | ------------------ | ------------------------ |
75+
| Description | 32-bit integer | 64-bit integer | Double-precision float | True/False value | 16-bit Unicode character |
7676
| Size (bytes) | 4 | 8 | 8 | 1 bit(\*) | 2 |
7777
| Range | $-2^{31}$ to $2^{31}-1$ | $-2^{63}$ to $2^{63}-1$ | `-1.7E+308` to `+1.7E+308` | true/false | `\u0000` to `\uffff` ($0-65535$) |
7878

content/1_General/Debugging_Checklist.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ most relevant to USACO.
2929

3030
<Info title="Code Snippets">
3131

32-
This module doesn't contain any code. See [Basic
33-
Debugging](/general/basic-debugging) and [Debugging C++](/general/debugging-cpp)
32+
This module doesn't contain any code. See [Basic
33+
Debugging](/general/basic-debugging) and [Debugging C++](/general/debugging-cpp)
3434
for more information.
3535

3636
</Info>
@@ -124,7 +124,7 @@ for more information.
124124
## Last Resort
125125

126126
- Rewrite your solution from the start.
127-
- Be sure to save a copy of your original solution. It's always possible that
127+
- Be sure to save a copy of your original solution. It's always possible that
128128
you might introduce more bugs in your new solution.
129129

130130
## Before Posting on the [USACO Guide Forum](https://forum.usaco.guide/)

content/1_General/Debugging_Cpp.mdx

+21-21
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ prerequisites:
99

1010
## Checking for Out of Bounds
1111

12-
Writing to an out of bounds array index is known as
13-
[buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow). C++ may or
14-
may not produce a runtime error upon buffer overflow. For example,
15-
the following code results in a runtime error on
12+
Writing to an out of bounds array index is known as
13+
[buffer overflow](https://en.wikipedia.org/wiki/Buffer_overflow). C++ may or
14+
may not produce a runtime error upon buffer overflow. For example,
15+
the following code results in a runtime error on
1616
[ide.usaco.guide](https://ide.usaco.guide), but outputs 4 on my computer.
1717

1818
```cpp
@@ -31,7 +31,7 @@ int main() {
3131
}
3232
```
3333

34-
To ensure that an error is raised when accessing an out of bounds index,
34+
To ensure that an error is raised when accessing an out of bounds index,
3535
you can use
3636
[vector::at](https://www.cplusplus.com/reference/vector/vector/at) instead of
3737
[vector::operator[]](https://www.cplusplus.com/reference/vector/vector/operator[])
@@ -66,7 +66,7 @@ terminate called after throwing an instance of 'std::out_of_range'
6666
<Info title="Line Numbers">
6767
6868
Note that the output above does not contain the line number where the runtime
69-
error occurred. To output the line number, you can use a debugger such as `gdb`
69+
error occurred. To output the line number, you can use a debugger such as `gdb`
7070
or `lldb`. See the section on [debuggers](#using-the-lldb-debugger) for more information.
7171
7272
</Info>
@@ -166,7 +166,7 @@ In this section and the following one we'll go over options you can add to your
166166
>
167167
Includes all the options below.
168168
</Resource>
169-
<Resource
169+
<Resource
170170
source="GCC"
171171
title="GCC Warning Options"
172172
url="https://web.archive.org/web/20221101061037/https://gcc.gnu.org/onlinedocs/gcc/Warning-Options.html"
@@ -185,7 +185,7 @@ We give examples for some of these below.
185185
186186
<Info title="For Users of USACO Guide IDE">
187187
188-
You can customize your compilation options in
188+
You can customize your compilation options in
189189
[ide.usaco.guide](https://ide.usaco.guide/).
190190
191191
</Info>
@@ -224,7 +224,7 @@ main.cpp:6:10: warning: ‘x’ is used uninitialized in this function [-Wuninit
224224
225225
### `-Wextra`
226226
227-
Enables some warning options not enabled by `-Wall`, such as
227+
Enables some warning options not enabled by `-Wall`, such as
228228
`-Wmissing-field-initializers`.
229229
230230
```cpp
@@ -372,7 +372,7 @@ main.cpp:6:13: runtime error: index 5 out of bounds for type 'int [5]'
372372
main.cpp:6:13: runtime error: load of address 0x7ffc4efaf2d4 with insufficient space for an object of type 'int'
373373
0x7ffc4efaf2d4: note: pointer points here
374374
11 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f0 15 40 00 00 00 00 00 00 00 00 00 00 00 00 00
375-
^
375+
^
376376
```
377377
378378
#### Example: Vector Out of Bounds
@@ -396,7 +396,7 @@ Output:
396396
Command exited with non-zero status 139
397397
```
398398
399-
With `-fsanitize=undefined`, a slightly more informative error message is
399+
With `-fsanitize=undefined`, a slightly more informative error message is
400400
produced:
401401
402402
```
@@ -427,7 +427,7 @@ main.cpp:6:14: runtime error: signed integer overflow: 1073741824 * 2 cannot be
427427
#### Example: Detecting Multiple Errors
428428
429429
By default, the undefined behavior sanitizer will attempt to continue after
430-
detecting an error. For example, the following program with
430+
detecting an error. For example, the following program with
431431
`-fsanitize=undefined` produces multiple runtime errors:
432432
433433
```cpp
@@ -509,7 +509,7 @@ Command exited with non-zero status 1
509509
510510
For more helpful information we should additionally compile with the `-g` flag,
511511
which generates a file containing debugging information based on the line
512-
numbering of the program.
512+
numbering of the program.
513513
514514
<Spoiler title="Standard Error">
515515
@@ -579,7 +579,7 @@ Shadow bytes around the buggy address:
579579
0x1000750d9870: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
580580
Shadow byte legend (one shadow byte represents 8 application bytes):
581581
Addressable: 00
582-
Partially addressable: 01 02 03 04 05 06 07
582+
Partially addressable: 01 02 03 04 05 06 07
583583
Heap left redzone: fa
584584
Freed heap region: fd
585585
Stack left redzone: f1
@@ -605,7 +605,7 @@ Command exited with non-zero status 1
605605
606606
### `-D_GLIBCXX_DEBUG`
607607
608-
This enables debug mode, which replaces each STL container with its
608+
This enables debug mode, which replaces each STL container with its
609609
corresponding debug container.
610610
611611
<Resources>
@@ -669,8 +669,8 @@ zsh: abort ./prog
669669
</Resources>
670670
671671
Recall the example from [Checking Out of Bounds](#checking-for-out-of-bounds)
672-
section where the output didn't contain the number of the line where the
673-
runtime error occurred. Below, we show how to use `lldb` to output the line
672+
section where the output didn't contain the number of the line where the
673+
runtime error occurred. Below, we show how to use `lldb` to output the line
674674
number. Assume the C++ source code is named `prog.cpp` and the executable
675675
is named `prog`.
676676
@@ -699,7 +699,7 @@ libsystem_kernel.dylib`__pthread_kill:
699699
-> 0x7ff80e01300e <+10>: jae 0x7ff80e013018 ; <+20>
700700
0x7ff80e013010 <+12>: movq %rax, %rdi
701701
0x7ff80e013013 <+15>: jmp 0x7ff80e00d1c5 ; cerror_nocancel
702-
0x7ff80e013018 <+20>: retq
702+
0x7ff80e013018 <+20>: retq
703703
Target 0: (prog) stopped.
704704
(lldb) bt
705705
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGABRT
@@ -715,15 +715,15 @@ Target 0: (prog) stopped.
715715
frame #9: 0x0000000100002629 prog`std::vector<int, std::allocator<int> >::at(this=0x00007ff7bfeff3d0, __n=1) at stl_vector.h:1175:16
716716
frame #10: 0x0000000100002421 prog`main at prog.cpp:10:17
717717
frame #11: 0x000000010001552e dyld`start + 462
718-
(lldb)
718+
(lldb)
719719
```
720720
721721
</Spoiler>
722722
723723
<Info>
724724
725725
As mentioned in [the previous module](/general/basic-debugging?lang=cpp#debuggers),
726-
there are many more things you can do with debuggers, but they aren't
726+
there are many more things you can do with debuggers, but they aren't
727727
particularly useful for competitive programming.
728728
729-
</Info>
729+
</Info>

content/1_General/Fast_IO.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ briefly mentions some ways of speeding up I/O:
1212

1313
> For some of the more advanced problems with larger input sizes, competitors may benefit from using fast input/output, to more easily pass within the time limit. For C++ users, you may want to add "ios_base::sync_with_stdio(false); cin.tie(0);" to the top of your main method if you are using cin/cout. For Java users, you may want to use BufferedReader instead of Scanner.
1414
15-
What do these do and how much of a difference do these actually make? We'll use the following
15+
What do these do and how much of a difference do these actually make? We'll use the following
1616
task to benchmark I/O speed:
1717

1818
## Example Task
@@ -955,4 +955,4 @@ details.
955955
956956
</Warning>
957957
958-
</CPPOnly>
958+
</CPPOnly>

content/1_General/Intro_CP.mdx

+1-1
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ Here is a task similar to the one that was solved in Kamil's video:
7878
<FocusProblem problem="general" />
7979

8080
<Info title="Beginners!">
81-
If you have prior programming experience we encourage you to register a Kattis account and submit a solution.
81+
If you have prior programming experience we encourage you to register a Kattis account and submit a solution.
8282
If not, feel free to skip ahead to the solution.
8383
</Info>
8484

content/1_General/Modules.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ Pay attention to content within warning blocks!
133133

134134
</Warning>
135135

136-
See [Working With MDX](/general/working-mdx) for more information regarding
136+
See [Working With MDX](/general/working-mdx) for more information regarding
137137
custom components.
138138

139139
## Statuses
@@ -152,6 +152,6 @@ Module (and Resource) Statuses:
152152
- Not Started - Self-explanatory.
153153
- Reading - Self-explanatory. Will show up under dashboard active modules.
154154
- Practicing - Self-explanatory. Will show up under dashboard active modules.
155-
- Complete - Self-explanatory.
155+
- Complete - Self-explanatory.
156156
- Skipped - Use for modules that you have skipped and intend to come back to. Will show up under dashboard active modules.
157157
- Ignored - Use for modules that you have skipped and do not intend to come back to. Will show up under dashboard active modules if enabled in settings.

content/1_General/Working_MDX.mdx

+2-2
Original file line numberDiff line numberDiff line change
@@ -560,7 +560,7 @@ Java code here
560560
<PySection />
561561
</LanguageSection>
562562

563-
If you want to render content for only a single language, it is more convenient
563+
If you want to render content for only a single language, it is more convenient
564564
to use `CPPOnly`, `JavaOnly`, or `PyOnly`:
565565

566566
````
@@ -691,4 +691,4 @@ C++ code here
691691
</Quiz.Explanation>
692692
</Quiz.Answer>
693693
</Quiz.Question>
694-
</Quiz>
694+
</Quiz>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
{
22
"MODULE_ID": "working-mdx"
3-
}
3+
}

0 commit comments

Comments
 (0)