This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Useful | |
// PBDS -- Sometimes gives quick AC in codeforces A,B | |
https://gist.github.com/maskmanlucifer/b0faa3f4a9672b3fe7a589437f1b5e6d | |
// Manchers -- One algo to solve 3,4 different type of problems efficiently | |
https://gist.github.com/maskmanlucifer/52bee9f747191a2bf736bcef8eea3cb8 | |
// Prime factorization -- Different ways | |
https://gist.github.com/maskmanlucifer/e8b54712040e90a8605122c415428106 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <bits/stdc++.h> | |
using namespace std; | |
int main() | |
{ | |
cout << "no" << '\n'; | |
return 0; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> PBDS (Policy based Data Structure) | |
>>> Resources : | |
1. https://codeforces.com/blog/entry/11080 (Sufficient) | |
2. https://www.geeksforgeeks.org/ordered-set-gnu-c-pbds/ | |
>>> Implementation | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Z's Algorithm | |
>>> Resources : | |
1. https://www.youtube.com/watch?v=CpZh4eF8QBw | |
2. https://cp-algorithms.com/string/z-function.html | |
>>> Implementation : | |
void pre(string s,ll *z) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Trie | |
>>> Resources: | |
T-0: https://leetcode.com/discuss/general-discussion/680706/article-on-trie-general-template-and-list-of-problems(best) | |
T-1: https://www.quora.com/q/threadsiiithyderabad/Tutorial-on-Trie-and-example-problems | |
T-2: https://www.techiedelight.com/cpp-implementation-trie-data-structure/ | |
T-3: https://www.youtube.com/watch?v=-urNrIAQnNo&t=55s | |
>>> Implementation: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> String hashing. | |
>>> Resources: | |
Tutorial no. 1: https://cp-algorithms.com/string/string-hashing.html | |
Tutorial n0. 2:https://www.quora.com/q/threadsiiithyderabad/String-Hashing-for-competitive-programming | |
>>> Implementation: | |
const ll mod=1000000009; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Segment tree | |
>>> Resources: | |
Tutorial no. 1: https://cp-algorithms.com/data_structures/segment_tree.html | |
Tutorial no. 2: https://www.geeksforgeeks.org/segment-tree-set-1-sum-of-given-range/ | |
Visualization : https://visualgo.net/bn/segmenttree?slide=1 | |
>>> Implementation: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> SCC (strongly connected component) | |
>>> Resources: | |
Tutorial no.1: https://cp-algorithms.com/graph/strongly-connected-components.html | |
Tutorial no.2: https://www.youtube.com/watch?v=RpgcYiky7uw | |
>>> Implementation: | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> Prime Factorisation | |
>>> Resources: | |
T-1: https://cp-algorithms.com/algebra/factorization.html | |
T-2: https://www.geeksforgeeks.org/prime-factorization-using-sieve-olog-n-multiple-queries/ | |
>>> Implementation:O(N log(log(N))) | |
int n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>> ncr % m | |
>>> Resources: | |
T-1 : https://cp-algorithms.com/combinatorics/binomial-coefficients.html | |
T-2 : https://www.geeksforgeeks.org/multiplicative-inverse-under-modulo-m/ | |
>>> Implementation | |
NewerOlder