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
  • 15:12 (UTC -12:00)
View GitHub Profile
>> Manchers Algo.
>>> Resources:
Tutorial no.1: https://cp-algorithms.com/string/manacher.html#:~:text=We%20describe%20the%20algorithm%20to,minor%20modification%20for%20this%20one.
>>> Implementation:
vector<ll> dp,dp1;
void mancher(string s)
>> KMP (String pattern searching)
>>> Resources:
1 : https://www.topcoder.com/community/competitive-programming/tutorials/introduction-to-string-searching-algorithms/
2 : https://www.geeksforgeeks.org/kmp-algorithm-for-pattern-searching/
>>> Implementation:
void prearr(string s1,ll *lps)
>> Floyd Warshall
>>> Reources:
T-1: https://www.geeksforgeeks.org/floyd-warshall-algorithm-dp-16/
T-2: https://www.youtube.com/watch?v=oNI0rf2P9gE
T-3: https://cp-algorithms.com/graph/all-pair-shortest-path-floyd-warshall.html
>>> Implementation:
>> ETF
>>> Resources:
T-1: https://cp-algorithms.com/algebra/phi-function.html
T-2: https://www.geeksforgeeks.org/eulers-totient-function/
>>> Implementation:
>> DSU
>>> Resources:
Tutorial: https://cp-algorithms.com/data_structures/disjoint_set_union.html
Visualization: https://visualgo.net/en/ufds?slide=1
>>> Implementation:
>> BIT aka Fenwick tree.
>>> Resources:
Tutorial no.1: https://cp-algorithms.com/data_structures/fenwick.html
Tutorial no.2: https://www.youtube.com/watch?v=CWDQJGaN1gY
Visualization: https://visualgo.net/bn/fenwicktree?slide=1
>>> Implementation:
>> Binary exponentiation
>>> Resources:
T-1: https://cp-algorithms.com/algebra/binary-exp.html
>>> Implementation:
ll be(ll a,ll b)
{
@maskmanlucifer
maskmanlucifer / sEPALIN.cpp
Created December 24, 2020 15:15
solution
/*
we either win, or we learn.
*/
#include <bits/stdc++.h>
#define HS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long
#define pll pair<ll,ll>
#define pb push_back
#define M 100'000'0007
#define lc '\n'
/*
we either win, or we learn.
*/
#include <bits/stdc++.h>
#define HS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long
#define pll pair<ll,ll>
#define pb push_back
#define M 100'000'0007
#define lc '\n'
/*
we either win, or we learn.
*/
#include <bits/stdc++.h>
#define HS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ll long long
#define pll pair<ll,ll>
#define pb push_back
#define M 100'000'0007
#define lc '\n'