MCPcopy Create free account

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

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

↓ 1 callersFunctionrec
Geometry/Delaunay Triangulation.cpp:60
↓ 1 callersMethodreduced_row_echelon_form
https://en.wikipedia.org/wiki/Row_echelon_form#Reduced_row_echelon_form
Math/Basis Vector Reduced Row Echelon Form.cpp:30
↓ 1 callersFunctionrem
Data Structures/MOs on tree.cpp:32
↓ 1 callersFunctionresultant
Let n = deg(A), m = deg(B). Treat deg(0) = 0. a[n] != 0, b[m] != 0 R(A, B) := b[m]^n prod_{j=0..m-1} A(b_roots[j]) // counted with multiplicities = (-
Math/Determinant of Permutant Matrix.cpp:33
↓ 1 callersFunctionresultant
Let n = deg(A), m = deg(B). Treat deg(0) = 0. a[n] != 0, b[m] != 0 R(A, B) := b[m]^n prod_{j=0..m-1} A(b_roots[j]) // counted with multiplicities = (-
Math/Determinant of Cyclic Matrix.cpp:33
↓ 1 callersFunctionrev_permute
Number Theory/Sum of nCi for a Fixed Large n.cpp:117
↓ 1 callersMethodreverse
reverse all the values from qL to qR
Data Structures/Implicit Treap.cpp:258
↓ 1 callersFunctionrho_pollard
Number Theory/Prime Factorization Fastest.cpp:65
↓ 1 callersMethodrollback
Strings/Palindromic Tree Persistent.cpp:74
↓ 1 callersMethodroot
Math/Polynomial.cpp:338
↓ 1 callersMethodrotateccw90
Geometry/Half Plane Intersection Dynamic.cpp:74
↓ 1 callersMethodsame
Data Structures/Persistent UnionFind.cpp:87
↓ 1 callersMethodsame
Data Structures/DSU Partially Persistent.cpp:18
↓ 1 callersMethodsame
Graph Theory/Krushkal's MST.cpp:12
↓ 1 callersFunctionseg_line_relation
intersection between segment ab and line cd 0 if do not intersect, 1 if proper intersect, 2 if segment intersect
Geometry/Geometry 2D.cpp:226
↓ 1 callersFunctionseg_seg_intersection
intersection point between segment ab and segment cd assuming unique intersection exists
Geometry/Voronoi Diagram.cpp:232
↓ 1 callersFunctionsegmented_sieve
Generate all primes from l to r using segmented sieve in O((r - l) log (r) + sqrt(r))
Number Theory/Segmented Sieve.cpp:27
↓ 1 callersMethodset
Data Structures/Persistent UnionFind.cpp:43
↓ 1 callersFunctionset_kth_bit
Sets the kth bit of x to 1 and returns the result
Basics/Bitwise Operations.cpp:41
↓ 1 callersMethodset_par
Graph Theory/Directed MST.cpp:32
↓ 1 callersMethodshl
Strings/Bit LCS.cpp:39
↓ 1 callersFunctionshow_extended_sequence
Math/Linear Recurrence With Polynomial Coefficients.cpp:157
↓ 1 callersFunctionsieve
Generate all primes up to limit using sieve of eratosthenes
Number Theory/Segmented Sieve.cpp:7
↓ 1 callersFunctionsieve
Number Theory/K Divisors.cpp:17
↓ 1 callersFunctionsieve
polynomial representation of f(p)
Number Theory/Min_25 Sieve.cpp:51
↓ 1 callersFunctionsieve
Number Theory/Linear Sieve for Multiplicative Functions.cpp:9
↓ 1 callersFunctionsieve
Number Theory/nCr Modulo Any Mod.cpp:86
↓ 1 callersFunctionsieve
credit: min_25 takes 0.5s for n = 1e9
Number Theory/Sieve upto 1e9.cpp:6
↓ 1 callersFunctionsieve
Number Theory/Sieve Linear.cpp:8
↓ 1 callersFunctionsieve
Number Theory/Smallest Number Having Exactly K Divisors.cpp:17
↓ 1 callersFunctionsieve
Number Theory/Prime Counting Function.cpp:18
↓ 1 callersFunctionsieve
Number Theory/Sieve.cpp:30
↓ 1 callersFunctionsieve
Number Theory/Powerful Number Sieve.cpp:49
↓ 1 callersFunctionsieve_v0
use bitset<N> is_prime; to have O(N/64) memory complexity using bitset you can solve upto around N = 10^8 in 1s
Number Theory/Sieve.cpp:10
↓ 1 callersFunctionsolve
Dynamic Programming Optimizations/Knuth Optimization.cpp:20
↓ 1 callersFunctionsolve
number of solutions of the equation x0 xor x1 xor ... x(n - 1) = x s.t. 0 <= xi <= ai O(n * log(MAX))
Dynamic Programming Optimizations/XOR Equation.cpp:60
↓ 1 callersFunctionsolve
number of solutions of the equation x0 xor x1 xor ... x(n - 1) = x s.t. 0 <= xi <= ai O(n * log(MAX))
Miscellaneous/XOR Equation Arbitrary Range.cpp:60
↓ 1 callersFunctionsolve
Math/Integration (Simpsons).cpp:20
↓ 1 callersFunctionsolve
Number of Perfect Matchings of a general graph SQRT of the Permanent of a zero diagonal symmetric matrix Takes ~2s for (38 * 38) matrix
Math/Hafnian of a Matrix.cpp:63
↓ 1 callersFunctionsolve
Math/Simplex Algorithm.cpp:136
↓ 1 callersFunctionsolve
Math/Basis Vector.cpp:105
↓ 1 callersFunctionsolve
Game Theory/Alpha Beta Pruning.cpp:19
↓ 1 callersFunctionsolve
Number Theory/Linear Diophantine Equation with N Variables.cpp:85
↓ 1 callersFunctionsolve
sum of f(i) for 1 <= i <= n pol is the polynomial representation of f(p)
Number Theory/Min_25 Sieve.cpp:116
↓ 1 callersFunctionsolve
Number Theory/Dirichlet Convolution.cpp:77
↓ 1 callersFunctionsolve
\sum{x=0}^{n}{x^k1 * ((ax + b)/c)^k2} //floor division 0^0 = 1 it solves for all _k1, _k2 s.t. _k1 + _k2 <= k1 + k2 (a * n + b) should fit in long lon
Number Theory/Generalized Floor Sum of Arithmetic Progressions.cpp:108
↓ 1 callersFunctionsolve
\sum{x=0}^{n}{x^k1 * ((ax + b)/c)^k2} //floor division 0^0 = 1 it solves for all _k1, _k2 s.t. _k1 + _k2 <= k1 + k2 (a * n + b) should fit in long lon
Number Theory/Sum of Arithmetic Progression Powers Divided.cpp:107
↓ 1 callersFunctionsolve
Computes sum_{k=0}^{n-1} x^{(a*k + b) % m} % mod
Number Theory/Sqrt Decomposition of Mod of Arithmetic Progression.cpp:139
↓ 1 callersFunctionsolve
credit: Min_25
Number Theory/Sum of nCi for a Fixed Large n.cpp:596
↓ 1 callersFunctionsolve
Number Theory/Powerful Number Sieve.cpp:90
↓ 1 callersFunctionsolve
Data Structures/MOs with DSU.cpp:140
↓ 1 callersFunctionsolve
Graph Theory/Euler Path Undirected.cpp:28
↓ 1 callersFunctionsolve
Graph Theory/Edge Coloring Simple Graph.cpp:19
↓ 1 callersFunctionsolve
Graph Theory/Edge Coloring Bipartite Graph.cpp:30
↓ 1 callersFunctionsolve
Graph Theory/Euler Path Directed.cpp:20
↓ 1 callersFunctionsolve
Graph Theory/Dynamic MST Offline.cpp:56
↓ 1 callersMethodsolve
Math/Reeds Sloane Algorithm.cpp:188
↓ 1 callersMethodsolve
Graph Theory/Stoer Wagner Algorithm.cpp:25
↓ 1 callersMethodsolve
Number of Perfect Matchings of a general graph SQRT of the Permanent of a zero diagonal symmetric matrix Takes ~2s for (38 * 38) matrix
Graph Theory/Hafnian of a Matrix.cpp:63
↓ 1 callersMethodsolve
returns {maxflow, mincost}
Graph Theory/Min Cost Max Flow.cpp:93
↓ 1 callersMethodsolve
Graph Theory/Maximum Clique and Maximum Independent Set Super Fast.cpp:67
↓ 1 callersMethodsolve
returns edge chromatic number, ans contains the edge coloring(colors are 1 indexed) supports multiple edges 0 indexed, O(M log M)
Graph Theory/Edge Coloring Bipartite Graph Faster.cpp:152
↓ 1 callersMethodsolve
Graph Theory/Maximum Closure Problem.cpp:107
↓ 1 callersMethodsolve
Graph Theory/Blossom Algorithm Weighted.cpp:202
↓ 1 callersMethodsolve0
Game Theory/Blue Red Hackenbush.cpp:99
↓ 1 callersMethodsolve1
Game Theory/Blue Red Hackenbush.cpp:105
↓ 1 callersFunctionspfa
Graph Theory/Minimum Mean Weight Cycle.cpp:9
↓ 1 callersFunctionspfa
Graph Theory/System Of Difference Constraints.cpp:35
↓ 1 callersMethodsplay
Data Structures/Top Tree.cpp:262
↓ 1 callersMethodsplay_2
Data Structures/Top Tree.cpp:218
↓ 1 callersMethodsplay_dir
Data Structures/Top Tree.cpp:209
↓ 1 callersMethodsplay_vert
Data Structures/Top Tree.cpp:239
↓ 1 callersMethodsqrt
Number Theory/Prime Number System.cpp:57
↓ 1 callersFunctionsquared_distance
Data Structures/KD Tree.cpp:39
↓ 1 callersFunctionst_numbering
Graph Theory/ST Numbering.cpp:49
↓ 1 callersFunctionstirling
returns stirling1st(n, i) for 0 <= i <= n
Number Theory/Stirling Number of the First Kind for Fixed n.cpp:86
↓ 1 callersFunctionstirling
stirling2nd(i, k) for 0 <= i <= n O(n log^2 n)
Number Theory/Stirling Number of the Second Kind for Fixed k.cpp:279
↓ 1 callersFunctionstirling
returns stirling1st(i, k) for 0 <= i < n O(n log^2 n)
Number Theory/Stirling Number of the First Kind for Fixed k.cpp:64
↓ 1 callersFunctionstring_matching
find occurrences of t in s where '?'s are automatically matched with any character res[i + m - 1] = sum_j=0 to m - 1_{s[i + j] * t[j] * (s[i + j] - t[
Strings/String Matching With FFT.cpp:59
↓ 1 callersMethodsub
Strings/Bit LCS.cpp:32
↓ 1 callersFunctionsubset_sum
if sum of the array values = x, then complexity is O(x sqrt(x)) returns the subset ids
Dynamic Programming Optimizations/Subset Sum in SQRT.cpp:8
↓ 1 callersFunctionsubset_sum
if sum of the array values = x, then complexity is O(x sqrt(x))
Graph Theory/Tree Orientation.cpp:27
↓ 1 callersFunctionsubset_sum_convolution
f*g(s)=sum_{s' $ s} {F(s')*G(s\s')} O(B * B * 2 ^ B)
Dynamic Programming Optimizations/SOS convolutions.cpp:53
↓ 1 callersMethodsubstr
Math/Faulhaber Formula Fastest.cpp:192
↓ 1 callersFunctionsuffix_array
Strings/Suffix Array.cpp:80
↓ 1 callersFunctionsuffix_array_DA
Strings/Suffix Array Isomorphic.cpp:12
↓ 1 callersMethodsum
sum of numbers in [l ,r] less than or equal to k
Data Structures/Wavelet Tree.cpp:73
↓ 1 callersFunctionsum_sigma0
credit: zimpha compute \sum_{i=1}^{n} sigma0(i) in ~O(n^{1/3}) time. it is also equal to \sum_{i=1}^{n} floor(n / i) takes ~100 ms for n = 1e18
Number Theory/Sum of The Number of Divisors in cbrt(n).cpp:12
↓ 1 callersFunctionsumsq
Number Theory/Linear Diophantine Equation Three Variables with Nonnegative Solutions.cpp:22
↓ 1 callersFunctionsweepline
Geometry/Point Location.cpp:47
↓ 1 callersFunctiontangents_from_point_to_polygon
(ccw, cw) tangents from a point that is outside this convex polygon returns indexes of the points ccw means the tangent from Q to that point is in the
Geometry/Geometry 2D.cpp:926
↓ 1 callersFunctiontoggle_kth_bit
Toggles the kth bit of x and returns the result
Basics/Bitwise Operations.cpp:51
↓ 1 callersFunctiontotient
Number Theory/Primitive Root.cpp:4
↓ 1 callersFunctiontotient
Number Theory/Multiplicative Order.cpp:14
↓ 1 callersMethodtraverse
Strings/Aho Corasick All Pair Occurrence Relation.cpp:54
↓ 1 callersMethodtruncate
Geometry/All Pair Segment Intersection.cpp:59
↓ 1 callersMethodtruncate
Data Structures/Square Root Decomposition With Reverse Update.cpp:36
↓ 1 callersMethodunit
Geometry/Geometry 3D.cpp:68
↓ 1 callersMethodunite
Data Structures/Dynamic Connectivity Problem.cpp:49
↓ 1 callersMethodunite
Data Structures/MOs with DSU.cpp:67
← previousnext →1,301–1,400 of 3,514, ranked by callers