diff --git a/content/Intro/Intro.md b/content/0_Intro/Intro.md similarity index 100% rename from content/Intro/Intro.md rename to content/0_Intro/Intro.md diff --git a/content/Intro/Intro_Containers.md b/content/0_Intro/Intro_Containers.md similarity index 100% rename from content/Intro/Intro_Containers.md rename to content/0_Intro/Intro_Containers.md diff --git a/content/Intro/Intro_Files.md b/content/0_Intro/Intro_Files.md similarity index 100% rename from content/Intro/Intro_Files.md rename to content/0_Intro/Intro_Files.md diff --git a/content/Intro/Intro_Prerequisites.md b/content/0_Intro/Intro_Prerequisites.md similarity index 100% rename from content/Intro/Intro_Prerequisites.md rename to content/0_Intro/Intro_Prerequisites.md diff --git a/content/Intro/Intro_Problems.md b/content/0_Intro/Intro_Problems.md similarity index 100% rename from content/Intro/Intro_Problems.md rename to content/0_Intro/Intro_Problems.md diff --git a/content/Bronze/Bronze_Complete.md b/content/1_Bronze/Bronze_Complete.md similarity index 100% rename from content/Bronze/Bronze_Complete.md rename to content/1_Bronze/Bronze_Complete.md diff --git a/content/Bronze/Bronze_Rect.md b/content/1_Bronze/Bronze_Rect.md similarity index 100% rename from content/Bronze/Bronze_Rect.md rename to content/1_Bronze/Bronze_Rect.md diff --git a/content/Bronze/Bronze_Simulation.md b/content/1_Bronze/Bronze_Simulation.md similarity index 100% rename from content/Bronze/Bronze_Simulation.md rename to content/1_Bronze/Bronze_Simulation.md diff --git a/content/Silver/Silver_Containers.md b/content/2_Silver/Silver_Containers.md similarity index 100% rename from content/Silver/Silver_Containers.md rename to content/2_Silver/Silver_Containers.md diff --git a/content/Silver/Silver_Graphs.md b/content/2_Silver/Silver_Graphs.md similarity index 100% rename from content/Silver/Silver_Graphs.md rename to content/2_Silver/Silver_Graphs.md diff --git a/content/Silver/Silver_Greedy.md b/content/2_Silver/Silver_Greedy.md similarity index 100% rename from content/Silver/Silver_Greedy.md rename to content/2_Silver/Silver_Greedy.md diff --git a/content/2_Silver/Silver_Psum.md b/content/2_Silver/Silver_Psum.md new file mode 100644 index 0000000..d53bcd7 --- /dev/null +++ b/content/2_Silver/Silver_Psum.md @@ -0,0 +1,7 @@ +# Silver - Prefix Sums + +See Ch 11 of https://www.overleaf.com/project/5e73f65cde1d010001224d8a + + - CPH 9.1 + - aka Cumulative Sum, Partial Sums + - 2D \ No newline at end of file diff --git a/content/Silver/Silver_Sorting.md b/content/2_Silver/Silver_Sorting.md similarity index 100% rename from content/Silver/Silver_Sorting.md rename to content/2_Silver/Silver_Sorting.md diff --git a/content/Gold/Gold_Amortized.md b/content/3_Gold/Gold_Amortized.md similarity index 100% rename from content/Gold/Gold_Amortized.md rename to content/3_Gold/Gold_Amortized.md diff --git a/content/Gold/Gold_BIT.md b/content/3_Gold/Gold_BIT.md similarity index 97% rename from content/Gold/Gold_BIT.md rename to content/3_Gold/Gold_BIT.md index 03efb02..8ab4a81 100644 --- a/content/Gold/Gold_BIT.md +++ b/content/3_Gold/Gold_BIT.md @@ -13,8 +13,7 @@ Given an array of size $N$, the task is to update the element at a single positi Sample Problems: * [CSES Range Sum Queries II](https://cses.fi/problemset/task/1648) - * [CSES Range XOR Queries](https://cses.fi/problemset/task/1650) - * essentially the same as above + * can also do range XOR queries w/ update * [SPOJ Inversion Counting](https://www.spoj.com/problems/INVCNT/) ## Binary Indexed Tree diff --git a/content/Gold/Gold_DP.md b/content/3_Gold/Gold_DP.md similarity index 100% rename from content/Gold/Gold_DP.md rename to content/3_Gold/Gold_DP.md diff --git a/content/Gold/Gold_Graphs.md b/content/3_Gold/Gold_Graphs.md similarity index 100% rename from content/Gold/Gold_Graphs.md rename to content/3_Gold/Gold_Graphs.md diff --git a/content/Gold/Gold_NT.md b/content/3_Gold/Gold_NT.md similarity index 100% rename from content/Gold/Gold_NT.md rename to content/3_Gold/Gold_NT.md diff --git a/content/3_Gold/Gold_Strings.md b/content/3_Gold/Gold_Strings.md new file mode 100644 index 0000000..e1a96af --- /dev/null +++ b/content/3_Gold/Gold_Strings.md @@ -0,0 +1,23 @@ +# Gold - Strings + +Author: Benjamin Qi + +## Hashing + +Use to quickly test whether two substrings are equal. + + - Tutorial + - CPH 26.3 + - [cp-algorithms String Hashing](https://cp-algorithms.com/string/string-hashing.html) + - [Anti-Hash Tests](https://codeforces.com/blog/entry/60442) + - On CodeForces educational rounds in particular, make sure to use random bases. + +My implementation can be found [here](https://github.com/bqi343/USACO/blob/master/Implementations/content/strings%20(14)/Light/HashRange%20(14.2).h). It uses two bases rather than just one to decrease the probability that two random strings hash to the same value. As mentioned in the articles above, there is no need to calculate modular inverses. + +### USACO Gold Problems (ok def need more) + + - [Cownomics](http://www.usaco.org/index.php?page=viewproblem2&cpid=741) + - Use two pointers; for a fixed $l$, keep extending $r$ to the right until the positions $l\ldots r$ explain spotiness. + - Hashing gives you a way to quickly check whether two substrings of different cow types are equal. So for a single $[l,r]$ pair you can check whether it works in $O(N\log N)$ time (and you only need to check $O(M)$ of these pairs in total). + - [Lightsout](http://www.usaco.org/index.php?page=viewproblem2&cpid=599) + - figure out whether this actually needs hashing? (haven't implemented) \ No newline at end of file diff --git a/content/Plat/Plat_2D.md b/content/4_Plat/Plat_2D.md similarity index 100% rename from content/Plat/Plat_2D.md rename to content/4_Plat/Plat_2D.md diff --git a/content/Plat/Plat_Bitset.md b/content/4_Plat/Plat_Bitset.md similarity index 100% rename from content/Plat/Plat_Bitset.md rename to content/4_Plat/Plat_Bitset.md diff --git a/content/Plat/Plat_Fracture.md b/content/4_Plat/Plat_Fracture.md similarity index 99% rename from content/Plat/Plat_Fracture.md rename to content/4_Plat/Plat_Fracture.md index 6c3f220..28d98de 100644 --- a/content/Plat/Plat_Fracture.md +++ b/content/4_Plat/Plat_Fracture.md @@ -1,5 +1,7 @@ # Platinum - Fracturing Search +Author: Benjamin Qi + ## General Outline ### Problem diff --git a/content/Geo.md b/content/4_Plat/Plat_Geo.md similarity index 100% rename from content/Geo.md rename to content/4_Plat/Plat_Geo.md diff --git a/content/Plat/Plat_Seg.md b/content/4_Plat/Plat_Seg.md similarity index 100% rename from content/Plat/Plat_Seg.md rename to content/4_Plat/Plat_Seg.md diff --git a/content/Plat/Plat_Slope.md b/content/4_Plat/Plat_Slope.md similarity index 99% rename from content/Plat/Plat_Slope.md rename to content/4_Plat/Plat_Slope.md index be98157..37510ec 100644 --- a/content/Plat/Plat_Slope.md +++ b/content/4_Plat/Plat_Slope.md @@ -1,5 +1,7 @@ # Platinum - Slope Trick +Author: Benjamin Qi + ## Tutorials Links: diff --git a/content/Plat/Plat_Static.md b/content/4_Plat/Plat_Static.md similarity index 100% rename from content/Plat/Plat_Static.md rename to content/4_Plat/Plat_Static.md diff --git a/content/Plat/Plat_Trees.md b/content/4_Plat/Plat_Trees.md similarity index 100% rename from content/Plat/Plat_Trees.md rename to content/4_Plat/Plat_Trees.md diff --git a/content/Gold/Gold_Strings.md b/content/Gold/Gold_Strings.md deleted file mode 100644 index 1da722d..0000000 --- a/content/Gold/Gold_Strings.md +++ /dev/null @@ -1,9 +0,0 @@ -# Gold - Strings - -## Trie - -## Hashing - - - CPH 26.1, 26.2, 26.3 - - Hashing (once)? - - \ No newline at end of file