Skip to content

Commit

Permalink
Merge branch 'master' into patch-1
Browse files Browse the repository at this point in the history
  • Loading branch information
JoltedCowIceCream authored Dec 23, 2024
2 parents ec769c4 + d322bfc commit c3fc4d2
Show file tree
Hide file tree
Showing 6 changed files with 136 additions and 145 deletions.
12 changes: 6 additions & 6 deletions CODEOWNERS
Validating CODEOWNERS rules …
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
/solutions/bronze/ @SansPapyrus683 @ryanchou-dev
/content/3_Silver/ @SansPapyrus683 @ryanchou-dev
/solutions/silver/ @SansPapyrus683 @ryanchou-dev
/content/4_Gold/ @dongliu0426 @envyaims
/solutions/gold/ @dongliu0426 @envyaims
/content/5_Plat/ @dustin-miao @dongliu0426
/solutions/platinum/ @dustin-miao @dongliu0426
/content/6_Advanced/ @dustin-miao @dongliu0426
/solutions/advanced/ @dustin-miao @dongliu0426
/content/4_Gold/ @dongliuu @envyaims
/solutions/gold/ @dongliuu @envyaims
/content/5_Plat/ @dongliuu
/solutions/platinum/ @dongliuu
/content/6_Advanced/ @dongliuu
/solutions/advanced/ @dongliuu
/content/extraProblems.json @SansPapyrus683 @envyaims
/content/team/ @SansPapyrus683 @ryanchou-dev
38 changes: 14 additions & 24 deletions content/1_General/Contests.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: 'Well-known programming contests and helpful tools for programming

## Frequent Contests

These websites hold contests that I frequently participate in.
These websites hold contests that I've often participated in.

<Resources>
<Resource
Expand All @@ -29,49 +29,40 @@ These websites hold contests that I frequently participate in.
</Resources>

- [AtCoder](https://beta.atcoder.jp/contests/archive)
- Probably the highest quality
- Beginner / Regular Contests: 4 or 6 problems, ~100 min
- Grand Contests: 6 problems, 110 - 150 min
- Difficulty isn't always reasonable ...
- Beginner, Regular, and Grand contests, 100-180 min
- [Codeforces](http://codeforces.com/problemset)
- Div 1-4: 5-6 problems (with some variations), 2 to 2.5 hrs
- [Topcoder](https://www.topcoder.com/my-dashboard/)
- Div 2, Div 1
- 75 min coding, 15 min challenge
- Solutions only tested after contest!
- Div 1-4, 2-3 hrs
- [DMOJ: Modern Online Judge](http://dmoj.ca/)
- at least one contest every month during school year
- practice implementation!!

<!-- Archive
- problem quality, difficulty ratings are ok but not always great -->
- usually 3 hrs, can choose your start time within a window (like USACO)

## Other Websites

<Resources>
<Resource title="Kattis" url="https://open.kattis.com/">
misc ICPC contests
<Resource title="TLX" url="https://tlx.toki.id/">
2-2.5 hrs
</Resource>
<Resource title="TOKI" url="https://tlx.toki.id/">
Indonesian
<Resource title="Kattis" url="https://open.kattis.com/">
misc ICPC contests (5 hrs)
</Resource>
<Resource title="CodeChef" url="http://codechef.com/">
monthly Long, Lunchtime, Cookoff
monthly Starters
</Resource>
</Resources>

These platforms no longer actively hold contests, but might be worth a look.
These platforms no longer actively hold contests, but it might be worth looking
at past problems.

<Resources>
<Resource title="CSAcademy" url="https://csacademy.com/contest/archive/">
see archive
</Resource>
<Resource title="Topcoder" url="https://www.topcoder.com/my-dashboard/">
Two divisions. 75 min coding, 15 min challenge phases. Solutions only tested after contest.
</Resource>
</Resources>

## Onsite Finals (Individual)

Let me know if there's something else I should try to qualify for!

<Resources>
<Resource
source="Facebook"
Expand Down Expand Up @@ -106,7 +97,6 @@ Let me know if there's something else I should try to qualify for!
>
recently updated
</Resource>

<Resource
title="Carrot"
url="https://chrome.google.com/webstore/detail/carrot/gakohpplicjdhhfllilcjpfildodfnnn"
Expand Down
52 changes: 27 additions & 25 deletions content/6_Advanced/String_Search.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -248,6 +248,26 @@ print(len(s))
<FocusProblem problem="manacherFocus" />
<Resources>
<Resource
source="HR"
title="Manacher's Algorithm"
url="https://www.hackerrank.com/topics/manachers-algorithm"
/>
<Resource
source="Medium"
title="Manacher’s Algorithm: Longest Palindromic Substring"
url="https://yuminlee2.medium.com/manachers-algorithm-longest-palindromic-substring-cc97fa615f8b"
starred
>
</Resource>
<Resource
source="cp-algo"
title="Manacher's Algorithm"
url="string/manacher.html"
/>
</Resources>
**Manacher's Algorithm** functions similarly to the **Z-Algorithm**. It
determines the longest palindrome centered at each character.
Expand Down Expand Up @@ -356,25 +376,6 @@ int main() {
</CPPSection>
</LanguageSection>
<Resources>
<Resource
source="HR"
title="Manacher's Algorithm"
url="https://www.hackerrank.com/topics/manachers-algorithm"
/>
<Resource
source="Medium"
title="Manacher’s Algorithm: Longest Palindromic Substring"
url="https://yuminlee2.medium.com/manachers-algorithm-longest-palindromic-substring-cc97fa615f8b"
starred
>
</Resource>
<Resource
source="cp-algo"
title="Manacher's Algorithm"
url="string/manacher.html"
/>
</Resources>
<Info title="Don't Forget!">
If s[l, r] is a palindrome, then s[l+1, r-1] is as well.
Expand Down Expand Up @@ -407,6 +408,12 @@ character palindrome must have been created from a palindrome of length $-1$
<FocusProblem problem="trieFocus" />
<Resources>
<Resource source="CPH" title="26.2" />
<Resource source="CF" title="Algorithm Gym" url="15729" />
<Resource source="PAPS" title="14.1 - Tries" />
</Resources>
A trie is a tree-like data structure that stores strings. Each node is a string, and each edge is a character.
The root is the empty string, and every node is represented by the characters along the path from the root to that node.
Expand Down Expand Up @@ -481,11 +488,6 @@ int main() {
</CPPSection>
</LanguageSection>
<Resources>
<Resource source="CPH" title="26.2" />
<Resource source="CF" title="Algorithm Gym" url="15729" />
<Resource source="PAPS" title="14.1 - Tries" />
</Resources>
<Problems problems="trie" />
Expand Down Expand Up @@ -523,7 +525,7 @@ For example, when transitioning from $i$ to $i+1$ in $S$ there only are two choi
1. If $node$ does have an outgoing edge with letter $S_{i+1}$, then move down the edge.
2. Otherwise, follow the failure link of $S_i$ and transition to letter $S_{i+1}$ from there.
The image below depicts how the structure looks like for the words $[a, ag, c, caa, gag, gc]$.
The image below depicts how the structure looks like for the words $[a, ag, c, caa, gag, gc, gca]$.
<center>
![Trie](./Trie.png)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ author: Ryan Chou

## Explanation

[Fermat's Little Theorem](/gold/modular) tells us that $a^{p - 1} \equiv 1 \pmod{p}$, so we can calculate $a^{b^c \pmod{1e9 + 7 - 1}} \pmod{1e9+7}$ with modular exponentiation.
Let $M = 10^{9} + 7$.

[Fermat's Little Theorem](/gold/modular) tells us that $a^{p - 1} \equiv 1 \pmod{p}$, so we can calculate $a^{b^c \pmod{M - 1}} \pmod{M}$ with modular exponentiation.

## Implementation

Expand Down
Loading

0 comments on commit c3fc4d2

Please sign in to comment.