ICPC Templates
Printable ICPC C++ templates ordered by priority, with the minimum notes needed to recall each one.
58 entries
Competitive programming notes, algorithm write ups and reusable C++ templates, most of them written while training for ICPC.
Printable ICPC C++ templates ordered by priority, with the minimum notes needed to recall each one.
maximum flow problem, minimum-cost flow problem
FFT is an efficient algorithm for computing the Discrete Fourier Transform (DFT) and its inverse, which has applications in polynomial multiplication, signal processing, and more.
DP for the knapsack problem, including 0-1, complete, and multiple knapsack variations.
Data structure for efficient key-value mapping.
An overview of various sorting algorithms, their time and space complexities, and stability.
stores a partition of a set into disjoint subsets.
a subset of the edges of a connected, edge-weighted undirected graph that connects all the vertices together, without any cycles and with the minimum possible total edge weight.
finding a path between two vertices in a graph such that the sum of the weights of its constituent edges is minimized.
Finding connected components and strongly connected components in graphs.
recursively breaks down a problem into two or more sub-problems of the same or related type, until these become simple enough to be solved directly.
Satisfiability of boolean formulas with 2 literals per clause
Depth First Search (DFS) and Breadth First Search (BFS) algorithms for graph traversal, including their applications and edge classifications.
DAG and Topological Order
Interesting equations and findings about Catalan Number
Congruence equation problems solutions
Linear sieve algorithms that optimized number sieving problems
Basic algorithms associated with number theory problems
DP for merging intervals with a cost function.
dictionary-matching algorithm that locates elements of a finite set of strings
An overview of basic syntax in C++ programming
AVL trees and red-black trees; Splay trees and treaps
Calculations are not limited to digits of the maximum of languages and computers
Monotonicity Problem and Extreme Value Problem
binary tree, binary search tree, and heap.
a graph whose vertices can be divided into two disjoint and independent sets
efficiently compute prefix sums of the values and update the values.
It is uniquely defined as a min-heap whose symmetric (in-order) traversal returns the original sequence.
点分治
effectively solve many problems that come down to queries on a tree
transform continuous numbers to discrete numbers
Several encapsulation struct methods implemented
use string buffer read to accelerate read and write
Hash string into numbers for quick query.
a space-partitioning data structure for organizing points in a k-dimensional space.
string-searching algorithm that searches for occurrences of a 'word' within a main 'text string'
query in O(log(n))
finding a maximum-length contiguous substring of a given string that is a palindrome
C++ code of matrix multiplication implementation.
a contiguous subarray with the largest sum
Introduces Mobius function and mobius inversion formula
爬山算法和模拟退火
storing information about intervals or segments.
devides a sequence into sqrt(n) blocks and solve by blocks
automates the execution of tests, confirm if the results are correct, test extreme data limits
strongly connected components
prefix tree used to store and retrieve strings from a dictionary or set.
虚树
Nothing matches that filter.