This repository holds all the boilerplate code that my team and I use during training and actual competitions. Almost all .cpp files are ready to be copied and pasted, including relevant comments. However, for anyone using this repository, we must caution that a good understanding of the code and the theory behind it is needed in order to be effective using it, as it will most likely need some form of modifications for your particular problem.
It is posible to auto generate a .pdf file for print based on all the content on the repository. In order to do this, you must compile the main.tex file.
Pull requests are welcome, as well as any suggestions by opening an issue or writing to my mail.
To my teammate and the original creator of this repo, Ignacio Hermosilla. To my coach Pablo Messina who provided a template and some of the code from his notes. And to everyone who has contributed to finding bugs and expanding the repo.
Redo the following
- Rewrite DP algorithms into small recursive form in LaTeX
- Knapsack
- MCM
- LIS
Add the following
- Python Cheat Sheet
- Search
- Binary
- Ternary
- Sparse Tables
- Persistent Segment Tree
- Treap
- Implicit Treap
- Persistent Treap
- RBST
- Wavelet Tree
- DP Examples
- Travelling Salesman
- Knapsack Problem
- Matrix Chain Multiplication
- Others?
- DP Optimizations
- Convex Hull Trick
- Divide & Conquer Optimization
- Knuth's Optimization
- Strongly Connected Components
- Tarjan
- Kosaraju
- Prim
- Toposort
- Heavy Light Decomposition
- FFT
- Rolling Hashing
- Aho-Corasick
- Suffix Tree
- Suffix Automaton
- Add Geometry
- Green's Theorem
- Convex Hull
- 2D
- 3D
If you think you deserve credit for any implementation in these notes, please contact us
- Strings
- KMP:
- Rolling Hashing:
- Suffix Tree: Javier Reyes
- Trie: Found by Ignacio Hermosilla
- Math
- CRT: Pablo Messina
- Factorial Factorization:
- Modular Arithmetic:
- nCr: Nicholas Mc-Donnell
- Polynomials: Nicholas Mc-Donnell
- Primality Checks:
- Sieve of Eratosthenes: Nicholas Mc-Donnell
- Trial Division: Nicholas Mc-Donnell
- Miller Rabin: Taken from these notes, with modifications by Nicholas Mc-Donnell
- Graphs:
- BFS: Nicholas Mc-Donnell
- DFS: Nicholas Mc-Donnell
- Dijsktra: Nicholas Mc-Donnell
- Bellman Ford: Nicholas Mc-Donnell
- Floyd Warshall: Nicholas Mc-Donnell
- Kruskal: Nicholas Mc-Donnell
- Union Find/DSU: Nicholas Mc-Donnell
- Dinic: Taken from these notes
- LCA: Javier Reyes
- Geometry:
- Green's theorem: Pablo Messina
- Simpson's Method: Nicholas Mc-Donnell
- Point: Nicholas Mc-Donnell & Pablo Messina
- DP:
- Knapsack: Nicholas Mc-Donnell
- LIS: Nicholas Mc-Donnell
- MCM: Nicholas Mc-Donnell
- Data Structures:
- Headers: Taken from these notes, with additions and modifications by Nicholas Mc-Donnell
- C++ Cheat Sheet: Pablo Messina