๐ USM Competitive Programming Handbook
A comprehensive collection of algorithms and data structures for competitive programming, maintained by Universidad Tรฉcnica Federico Santa Marรญa (USM) students.
๐ Quick Start
Prerequisites
- Typst - A modern markup-based typesetting system
Compilation
This generates a PDF handbook with all algorithms organized by category.
๐ Contents
The handbook includes implementations for:
- ๐ง General - Templates and troubleshooting guides
- ๐ค Strings - String processing algorithms (KMP, Z-algorithm, Suffix Array, Trie, etc.)
- โก Algorithms - General algorithms (Mo's algorithm, Tortoise-Hare cycle detection)
- ๐ Data Structures - Advanced data structures (Segment Trees, Fenwick Trees, Treaps, etc.)
- ๐งฎ Mathematics - Number theory, linear algebra, and polynomial operations
- ๐ Graphs - Graph algorithms (DFS, BFS, Shortest paths, Network flows, etc.)
- ๐ Geometry - Computational geometry (Convex Hull, Point operations, etc.)
- ๐ฏ Dynamic Programming - DP optimizations and classic problems
- ๐ Combinatorics - Advanced combinatorial algorithms
๐ Contributing Guidelines
Code Style
- Naming: Use lowercase with hyphens for folders and files (
knuth-morris-prattโkmp) - File Extensions: Only
.cppand.typfiles allowed - Indentation: Use exactly 2 spaces (no tabs)
- Length: Keep filenames under 18 characters when possible
- Atomicity: Each file should contain only one algorithm/data structure
Code Requirements
- Documentation: Every C++ file must start with a multi-line comment describing the algorithm
- No Macros: Avoid competitive programming macros like
rep,repx, etc. - Clean Code: Write readable, well-structured code
File Structure
content/
โโโ algorithms/ # General algorithms
โโโ combinatorial/ # Combinatorial algorithms
โโโ data-structures/ # Advanced data structures
โโโ dynamic-programming/ # DP techniques
โโโ general/ # Templates and utilities
โโโ geometry/ # Computational geometry
โโโ graphs/ # Graph algorithms
โโโ maths/ # Mathematical algorithms
โโโ strings/ # String algorithms
๐ฏ Project Goals
- Concise Implementations - Provide short, efficient algorithm implementations
- Educational Value - Include clear descriptions and explanations
- Competitive Ready - Code optimized for programming contests
- Comprehensive Coverage - Cover all essential competitive programming topics
๐ง Roadmap
- Additional dynamic programming techniques
- Voronoi diagrams and Delaunay triangulation
- Extended geometry primitives (lines, circles, 3D operations)
- 3D Convex Hull algorithms
- Karatsuba polynomial multiplication
- Advanced polynomial operations
๐ฅ Team
Maintainers:
- Gabriel Carmona (MrYhatoh)
- Carlos Lagos (CharlesLakes)
- Sebastiรกn Torrealba (storrealbac)
- Abner Vidal (abner_vidal)
Contributors:
- Javier Oliva (JOliva)
- Marcelo Lemus (MarceloL)
๐ License
This project is licensed under the terms specified in the LICENSE file.
Built with โค๏ธ for the competitive programming community at USM