MCPcopy Create free account

hub / github.com/ShahjalalShohag/code-library / functions

Functions3,514 in github.com/ShahjalalShohag/code-library

↓ 1 callersMethodunite
Graph Theory/Three Edge Connectivity.cpp:36
↓ 1 callersFunctionunset_kth_bit
Sets the kth bit of x to 0 and returns the result
Basics/Bitwise Operations.cpp:46
↓ 1 callersFunctionupd
Dynamic Programming Optimizations/Persistent Li Chao Tree.cpp:31
↓ 1 callersMethodupd
Miscellaneous/MEX of all Subarrays.cpp:19
↓ 1 callersMethodupd
Strings/String Hashing With Updates and Reverse.cpp:62
↓ 1 callersMethodupd
Data Structures/Segment Tree NonRecursive.cpp:30
↓ 1 callersMethodupd
Data Structures/Segment Tree Persistent.cpp:22
↓ 1 callersMethodupd
Data Structures/Segment Tree 2D Dynamic.cpp:122
↓ 1 callersMethodupd
Data Structures/Segment Tree Persistent Lazy.cpp:69
↓ 1 callersMethodupd
Data Structures/HLD.cpp:39
↓ 1 callersMethodupd
add x to a[i], basically the change occurs for all t[n][i] where n is a candidate node so we just create a lazy array to remember the change for each
Data Structures/XOR Segment Tree.cpp:41
↓ 1 callersMethodupdate
add val in all the values from a[qL] to a[qR] positions
Data Structures/Implicit Treap.cpp:246
↓ 1 callersMethodupdate_max
range maximize query
Data Structures/Segment Tree Beats.cpp:248
↓ 1 callersMethodupdate_min
range minimize query
Data Structures/Segment Tree Beats.cpp:244
↓ 1 callersMethodval
Number Theory/Prime Number System.cpp:42
↓ 1 callersFunctionwinding_number
returns 1e9 if the point is on the polygon
Geometry/Voronoi Diagram.cpp:209
↓ 1 callersFunctionwinding_number
returns 1e9 if the point is on the polygon
Geometry/Geometry 2D.cpp:696
↓ 1 callersFunctionyo
Dynamic Programming Optimizations/Connected Component DP.cpp:7
↓ 1 callersFunctionyo
par = parity of the number of kth bits which are on f = if we have offed any kth bit
Dynamic Programming Optimizations/XOR Equation.cpp:31
↓ 1 callersFunctionyo
sum of i1 * i2 * ... ik s.t. 0 <= i1 < i2 < ... < ik <= n O(k^2 log n), can be optimized to O(k logk logn)
Dynamic Programming Optimizations/x2 +1 trick.cpp:37
↓ 1 callersFunctionyo
Dynamic Programming Optimizations/DP on Convex Hulls.cpp:36
↓ 1 callersFunctionyo
Dynamic Programming Optimizations/Divide and Conquer Optimization.cpp:29
↓ 1 callersFunctionyo
Dynamic Programming Optimizations/Persistent Li Chao Tree.cpp:94
↓ 1 callersFunctionyo
Dynamic Programming Optimizations/Digit DP.cpp:15
↓ 1 callersFunctionyo
number of ways to select k linearly independant vectors of length n mul(q^n - q^i) over 0 <= i < k
Math/q Binomial.cpp:118
↓ 1 callersFunctionyo
finds the determinant of (a - xI) in O(n^2), here a is a hessenberg matrix
Math/Characteristic Polynomial Faster.cpp:57
↓ 1 callersFunctionyo
Math/Hafnian of a Matrix.cpp:41
↓ 1 callersFunctionyo
up / down = sum_{i=l}^{r}{1/(1-a[i]*x)}
Math/Faulhaber Formula Fastest.cpp:384
↓ 1 callersFunctionyo
Given a polynomial of degree k, f(x) = \sum_{i = 0}^{k}{c_i * x^i} and c_k != 0 Let S(n) = \sum_{i = 0}^{n}{a^i * f(i)} Given S(0), S(1), ... S(k) fin
Math/Polynomial Sum.cpp:81
↓ 1 callersFunctionyo
number of solutions of the equation x_0 + ... + x_(n-1) = s s.t. 0 <= x_i <= a_i O(2^(n/2)*n^2)
Math/Number of Solutions of A Equation MITM.cpp:95
↓ 1 callersFunctionyo
Math/All Possible Perfect Matching XOR Values.cpp:7
↓ 1 callersFunctionyo
Math/BerleKamp Massey.cpp:87
↓ 1 callersFunctionyo
a[k] = c[0] * a[k - 1] + c[1] * a[k - 2] + ... for k >= n
Math/Generating Function of a Linear Recurrence.cpp:61
↓ 1 callersFunctionyo
Math/Lagrange Interpolation with Polynomial Extraction.cpp:183
↓ 1 callersFunctionyo
ans[n] = \sum_{i = 0}^{n-1}{ans[i] * a[n - i]}
Math/NTT Online (D&C).cpp:123
↓ 1 callersFunctionyo
Strings/Prefix Automaton.cpp:42
↓ 1 callersFunctionyo
Game Theory/Alpha Beta Pruning.cpp:22
↓ 1 callersFunctionyo
ans[i] = number of partitions of i O(n sqrt(n)) takes 1.5s for n = 5e5
Number Theory/Partition Function.cpp:37
↓ 1 callersFunctionyo
returns the number of distinct values of (a^k % n) over all integers a
Number Theory/Number of Distinct Kth Powers Modulo n.cpp:28
↓ 1 callersFunctionyo
no memorization needed! sum of f(i) s.t. spf[i] > primes[j]
Number Theory/Min_25 Sieve.cpp:88
↓ 1 callersFunctionyo
number of solutions to ax + by + cz = n s.t. x, y, z >= 0 a, b, c >= 1 O(log(max(a, b, c))); paper: https://cs.uwaterloo.ca/journals/JIS/VOL23/Binner/
Number Theory/Linear Diophantine Equation Three Variables with Nonnegative Solutions.cpp:67
↓ 1 callersFunctionyo
mul (1 - ix)
Number Theory/Stirling Number of the Second Kind for Fixed k.cpp:266
↓ 1 callersFunctionyo
returns the number of solutions to the equation x_1 + x_2 + ... + x_n = s and 0 <= l <= x_i <= r
Number Theory/Number of Solutions to a Basic Linear Algebraic Equation.cpp:54
↓ 1 callersFunctionyo
Number Theory/Smallest Number Having Exactly K Divisors.cpp:29
↓ 1 callersFunctionyo
returns the number of solutions to the equation x_0 + ... + x_(n-1) = s s.t. 0 <= x_i <= a_i O(2^(n/2)*n^2)
Number Theory/Number of Solutions to a Basic Linear Algebraic Equation with Variable Upper Bound Constraints.cpp:93
↓ 1 callersFunctionyo
if x >= log2(m), then a^x = a^(MOD(x, phi(m))) % m
Number Theory/Power Tower.cpp:35
↓ 1 callersFunctionyo
O((max number of divisors of a[i]) * n * log(max a[i])) but faster in practice lcm(a1, a2, ... an) = lcm(lcm(a1, ..., a[n-1]), an) = lcm(a1, ...,
Number Theory/LCM of Fibonacci Numbers.cpp:42
↓ 1 callersFunctionyo
Data Structures/Centroid Decomposition Persistent.cpp:60
↓ 1 callersFunctionyo
Data Structures/Binarizing a Tree.cpp:61
↓ 1 callersFunctionyo
Data Structures/Sparse Table 2D.cpp:9
↓ 1 callersFunctionyo
Graph Theory/Counting Labeled Graphs.cpp:54
↓ 1 callersFunctionyo
Graph Theory/Maximum Density Subgraph.cpp:88
↓ 1 callersMethodyo
Strings/Bit LCS.cpp:27
↓ 1 callersMethodyo
Graph Theory/Tree Isomorphism.cpp:75
↓ 1 callersFunctionz_function
An element Z[i] of Z array stores length of the longest substring starting from str[i] which is also a prefix of str[0..n-1]. The first entry of Z arr
Strings/Z Algorithm.cpp:8
↓ 1 callersFunctionzeta_transform
Every input vector must need to be of size 1<<B z(f(s))=\sum_{s' $ s}{f(s')} O(B * 2 ^ B) zeta transform is actually SOS DP
Dynamic Programming Optimizations/SOS convolutions.cpp:12
MethodAC
Strings/Aho Corasick.cpp:13
MethodAhoCorasick
each string contains 'a' and 'b'
Strings/Aho Corasick All Pair Occurrence Relation.cpp:9
MethodAngle
Geometry/Half Plane Intersection Dynamic.cpp:63
MethodBIT
Data Structures/BIT.cpp:9
MethodBIT
Data Structures/BIT with Range Update and Range Query.cpp:8
MethodBIT2D
Data Structures/BIT 2D with Range Update and Range Query.cpp:8
MethodBasis
Math/Basis Vector Reduced Row Echelon Form.cpp:9
MethodBasis
Math/Basis Vector.cpp:14
MethodBasis
Math/Basis Vector ft Weighted Linearly Independent Vectors.cpp:9
MethodBerlekampMassey
Math/Reeds Sloane Algorithm.cpp:16
MethodBigInt
Miscellaneous/BigInt.cpp:63
MethodBitset
Miscellaneous/Bitset Custom.cpp:28
MethodBlock
Data Structures/Square Root Decomposition With Reverse Update.cpp:10
MethodBlossom
Game Theory/Matching Game On A Graph.cpp:13
MethodBlossom
Graph Theory/Blossom Algorithm.cpp:13
MethodBlossom
Graph Theory/Blossom Algorithm Weighted.cpp:19
MethodCircleUnion
Geometry/Geometry 2D.cpp:473
MethodColorfulOracle
Miscellaneous/Matroid Intersection Color Graphic Matroid.cpp:92
MethodColorfulOracle
Miscellaneous/Matroid Intersection Color Linear Matroid.cpp:89
MethodCombi
Math/Polynomial Sum.cpp:36
MethodCombi
Number Theory/Stirling Number of the Second Kind for Fixed k.cpp:249
MethodCombi
Number Theory/Number of Solutions to a Basic Linear Algebraic Equation.cpp:36
MethodCombi
Number Theory/Prefix Sum Queries of nCi.cpp:36
MethodComponents
Graph Theory/Three Edge Connectivity.cpp:8
MethodDST
Data Structures/Disjoint Sparse Table.cpp:18
MethodDSU
Data Structures/DSU with Rollbacks.cpp:10
MethodDSU
Data Structures/DSU.cpp:9
MethodDSU
Data Structures/Queue Undo Trick.cpp:10
MethodDSU
initial time
Data Structures/DSU Partially Persistent.cpp:9
MethodDSU
Graph Theory/Directed MST.cpp:30
MethodDSUQueue
Data Structures/DSU with Rollbacks.cpp:78
MethodDSUQueue
Data Structures/Queue Undo Trick.cpp:79
MethodDinic
Graph Theory/Dinics Algorithm.cpp:17
MethodDinic
Graph Theory/Unique Min Cut.cpp:17
MethodDinic
Graph Theory/L R Flow with Dinic.cpp:17
MethodDinic
Graph Theory/Maximum Closure Problem.cpp:17
MethodDinic
Graph Theory/Gomory Hu Tree.cpp:17
MethodDinic
Graph Theory/Maximum Density Subgraph.cpp:17
MethodEdge
Graph Theory/Min Cost Max Flow with Negative Cycles.cpp:16
MethodEnlarge
Graph Theory/Hungarian Algorithm.cpp:82
MethodEuler
Graph Theory/Edge Coloring Bipartite Graph Faster.cpp:15
MethodFFT
Miscellaneous/BigInt.cpp:379
MethodGraphBasis
Miscellaneous/Matroid Intersection Color Graphic Matroid.cpp:21
MethodGraphicOracle
Miscellaneous/Matroid Intersection Color Graphic Matroid.cpp:55
← previousnext →1,401–1,500 of 3,514, ranked by callers