A comprehensive collection of solutions to competitive programming problems from top-tier programming contests. This repository includes solutions in C++ from contests such as IOI, USACO, CCC, CodeForces, and more, along with detailed algorithm explanations and data structure implementations.
The solutions are organized by contest and difficulty level, with implementations of common algorithms and data structures essential for competitive programming success. Each solution is written in C++17 using modern competitive programming practices and conventions.
Comprehensive guides organized by topic for systematic learning:
| Document | Description |
|---|---|
| Notes/basics.md | Core C++/STL, I/O, complexity analysis |
| Notes/strategies.md | Problem-solving patterns and heuristics |
| Notes/data_structures.md | Arrays, stacks, trees, heaps, hash tables |
| Notes/sorting.md | Sorting algorithms with implementations |
| Notes/searching.md | Search algorithms (binary, linear, etc.) |
| Notes/mathematics.md | Number theory, combinatorics, modular arithmetic |
| Notes/greedy.md | Greedy algorithm strategies |
| Notes/graphs.md | Graph algorithms and traversal techniques |
| Notes/dp.md | Dynamic programming patterns |
| Notes/backtracking.md | Backtracking and constraint satisfaction |
| Notes/linear_algebra.md | Matrices, transformations, grid problems |
| CP Template | Production-ready competitive programming template |
| Contest | Level | Solutions |
|---|---|---|
| USACO | Bronze → Platinum | Solutions |
| CCC | Junior → Senior | Solutions |
| CodeForces | Div. 1-3 | Solutions |
| IOI | International Olympiad in Informatics | Solutions |
| CSES | Introductory | Solutions |
| CCO | Canadian Computing Olympiad | Solutions |
| Other Competitions | Various | Solutions |
Competitive_Programming-1/
├── Algorithms/ # Core algorithms library
│ ├── template.cpp # Main CP template with utilities
│ ├── Sorting/ # Sorting algorithms
│ │ ├── bubble_sort/ # Bubble sort implementation
│ │ ├── insertion_sort/ # Insertion sort implementation
│ │ ├── merge_sort/ # Merge sort implementation
│ │ ├── quick_sort/ # Quick sort implementation
│ │ └── selection_sort/ # Selection sort implementation
│ ├── searching/ # Search algorithms
│ │ ├── binary_search/ # Binary search implementation
│ │ ├── exponential_search/ # Exponential search implementation
│ │ ├── interpolation_search/# Interpolation search implementation
│ │ ├── jump_search/ # Jump search implementation
│ │ └── linear_search/ # Linear search implementation
│ ├── backtracking/ # Backtracking algorithms
│ │ ├── all_permutations/ # Generate all permutations
│ │ ├── all_combinations/ # Generate all combinations
│ │ ├── string_pattern/ # String pattern matching
│ │ ├── generating_words/ # Word generation from grids
│ │ ├── hamiltonian_paths/ # Hamiltonian path finding
│ │ ├── k_colorable_configurations/ # Graph coloring
│ │ ├── knight_tour/ # Knight's tour problem
│ │ ├── topological_sort/ # Topological ordering
│ │ └── minimax/ # Minimax algorithm (tic-tac-toe)
│ ├── strategies/ # Problem-solving strategies
│ │ ├── lru_cache/ # LRU cache implementation
│ │ ├── k_closest_points/ # K closest points problem
│ │ ├── subarray_sum/ # Subarray sum problems
│ │ └── ... (15 total)
│ ├── collections_containers/ # Data structures
│ │ ├── avl_tree/ # AVL tree implementation
│ │ ├── binary_search_tree/ # BST implementation
│ │ ├── hash_table/ # Hash table implementation
│ │ └── ... (9 total)
│ ├── graph_theory/ # Graph algorithms (BFS, DFS, Dijkstra)
│ ├── DP/ # Dynamic programming problems
│ └── resources/ # Diagrams and references
├── Notes/ # Comprehensive documentation
│ ├── basics.md # C++/STL fundamentals
│ ├── strategies.md # Problem-solving guide
│ ├── data_structures.md # Data structures reference
│ ├── sorting.md # Sorting algorithms
│ ├── searching.md # Searching algorithms
│ ├── mathematics.md # Math for CP
│ ├── greedy.md # Greedy algorithms
│ ├── graphs.md # Graph theory
│ ├── dp.md # Dynamic programming
│ ├── backtracking.md # Backtracking guide
│ └── linear_algebra.md # Matrices and grids
├── USACO/ # USACO problems by year/level
├── CCC/ # Canadian Computing Contest
├── CodeForces/ # CodeForces submissions
├── CSES question set/ # CSES problem solutions
├── IOI/ # International Olympiad
├── CCO/ # Canadian Computing Olympiad
├── Trivial Competitions/ # Other contest platforms
├── LeetCode questions/ # LeetCode solutions
└── z_misc questions/ # Miscellaneous practice
The Algorithms/template.cpp contains my CP template with: