Skip to content

My competitive programming templates of algorithms, data structures and utilities

Notifications You must be signed in to change notification settings

ALeonidou2005/cp-templates

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Competitive Programming Templates

These are the CP templates I've written during my competitive programming journey in high school. All implementations have been tested and used at various points along the way. Some include comments and explanations within the source code.

What's Inside

Algorithms (61 implementations)

  • Binary Search (4) - Standard Binary Search, STL Functions, Count/Left/Right Variations
  • Dynamic Programming (13) - Classic DP: Coins, Knapsack, LIS, LCS, Kadane, and more
  • Graphs (10) - Dijkstra, Bellman-Ford, Floyd-Warshall, Kruskal, Kosaraju, 2-SAT, Topological Sort
  • Mathematics (11) - Number theory, Modular Arithmetic, Combinatorics, Prime sieves
  • Range Queries (5) - Segment Trees, Lazy Propagation, Prefix Sums, Ordered Set
  • Strings (7) - Z-algorithm, Aho-Corasick, Rabin-Karp, Suffix Arrays, Manacher's
  • Trees (4) - LCA, Diameter, Center, Re-rooting
  • Other (7) - Bitwise operations, Ternary Search, Two-Pointers, Game Theory

Templates (6 utilities)


Feel free to use these templates for your own competitive programming practice and contests. If you find any mistakes or have suggestions for improvements, I'd appreciate hearing about them!

License

This repository is provided as-is for educational and competitive programming purposes. You are free to use, modify, and distribute these templates for personal practice, contests, and learning. No warranty is provided.

Contact

Contact me at [email protected] or open an issue on this repository for questions, suggestions, or bug reports.

About

My competitive programming templates of algorithms, data structures and utilities

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages