Skip to content

Instantly share code, notes, and snippets.

View maskmanlucifer's full-sized avatar
:electron:
Wired in

Aman Kumar Singh maskmanlucifer

:electron:
Wired in
  • Directi
  • Bengaluru
  • 03:50 (UTC -12:00)
View GitHub Profile
@maskmanlucifer
maskmanlucifer / lucifer.cpp
Created October 3, 2022 16:34
maskman_lucifer
// 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
#include <bits/stdc++.h>
using namespace std;
int main()
{
cout << "no" << '\n';
return 0;
}
>> 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
>> 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)
>> 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:
>> 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;
>> 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:
>> 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:
>> 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;
>> 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