Skip to content

Nonbangkok/Competitive_Programming

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

107 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Competitive Programming

Introduction

I started competitive programming with C/C++ at the age of 15, beginning with basic programming fundamentals. Later, I developed a strong interest in Data Structures and Algorithms, which led me to create this repository to share my code with others who are interested in competitive programming. Feel free to point out any mistakes or suggest improvements!

Note: My code contains many custom #define macros for faster coding. To make my code more readable and understandable, please use ALTHEA - a tool that helps convert competitive programming code into more readable format.

Knowledge Structure

Data Structures

  • STL Containers
    • Vector, Queue, Stack
    • Set, Map, Priority Queue
  • Advanced Structures
    • Disjoint Set Union (DSU)
    • Binary Search Trees
    • Heaps
    • Trie
    • Range Minimum Query (RMQ)
    • Monotonic Stack/Queue

Algorithms

  • Dynamic Programming (DP)
    • Classic problems (knapsack, coin change, LIS)
    • Grid-based DP
    • State compression DP
    • Tree DP
  • Graph Algorithms
    • BFS/DFS traversal
    • Shortest path algorithms (Dijkstra, Bellman-Ford)
    • Minimum Spanning Tree (Kruskal, Prim)
    • Strongly Connected Components
    • Cycle detection
  • Tree Algorithms
    • Tree traversal and diameter
    • Lowest Common Ancestor (LCA)
    • Tree matching
    • Tree distances
  • Binary Search
    • Standard binary search
    • Binary search on answer
    • Lower/upper bound implementations
  • Greedy Algorithms
  • Divide and Conquer
    • Closest pair of points
    • Merge sort variations

Problem Categories

  • Sorting and Searching
  • Range Queries
  • String Algorithms
  • Mathematical Problems
  • Interactive Problems
  • State Space Search

Folder Structure

Main Directories

POSN/ - Thai Competitive Programming Training

  • Camp_1_65/, Camp_1_66/, Camp_1_67/ - Basic training materials
  • Camp_2/ - Intermediate level with organized topics:
    • DP/ - Dynamic programming problems
    • Graph/ - Graph algorithms and problems
    • Tree/ - Tree data structures and algorithms
    • DSU/ - Disjoint Set Union implementations
    • STL/ - Standard Template Library implementations
    • String_Algorithm/ - String algorithms
    • Math/ - Mathematical problems
    • Greedy/ - Greedy algorithm problems
    • Heap/ - Priority queue and heap problems
    • Sweep_Line/ - Sweep line algorithm problems
    • State_Space_Search/ - State Space Search problems
  • Camp_3/ - Advanced topics:
    • Coordinate_Compression/ - Coordinate compression techniques
    • RMQ/ - Range Minimum Query implementations
    • Trie/ - Trie problems
    • Shortest_Path_With_State/ - Extra State Shortest Path problems
  • Contest/ - Contest problems by year (2021-2024)
  • TOI/` - Thailand Olympiad in Informatics problems
  • IOI/` - International Olympiad in Informatics problems
  • JOI/` - Japanese Olympiad in Informatics problems

Contest/ - Various Programming Contests

  • TUMSO/ - TUMSO (2018-2021)
  • TUSCO/ - TUSCO (2022-2024)
  • CodeCube/ - CodeCube contest problems
  • CodeAlgo/ - CodeAlgo contest problems
  • Crack_n_Code/ - Crack n Code contest problems
  • Junior_Dev/ - Junior Dev contests
  • Gean_Dev/ - Gean Dev contests
  • Pre_TOI/ - Pre-TOI contest problems
  • TPCPC/ - TPCPC contest problems
  • SYPH/ - SYPH contest problems
  • Skgrader/ - Skgrader contest problems

Grader/ - Online Judge Problems

  • Cses/ - CSES Problem Set organized by topics:
    • Introductory_Problems/ - Basic problems
    • Dynamic_Programming/ - DP problems
    • Graph_Algorithms/ - Graph theory problems
    • Tree_Algorithms/ - Tree problems
    • Sorting_and_Searching/ - Sorting and searching problems
    • Range_Queries/ - Range query problems
    • Additional_Problem/ - Additional problems
  • CodeForces/ - CodeForces contest problems organized by rounds
  • AtCoder/ - AtCoder contest problems
  • Leetcode/ - LeetCode problems
  • Hackerrank/ - HackerRank problems
  • SPOJ/ - Sphere Online Judge problems
  • Programming/ - General programming problems

Auto/ - Algorithm Templates and Patterns

  • dp/ - Dynamic programming templates
  • Graph/ - Graph algorithm templates
  • Bisearch/ - Binary search templates
  • Pattern/ - Common coding patterns

Interactive/ - Interactive Problem Prototypes

  • Prototype/ - Algorithm prototypes with documentation:
    • binary_search/ - Binary search implementation
    • closest_pair/ - Closest pair of points
    • cycle_finder/ - Cycle detection algorithms
    • dsu/ - Disjoint Set Union
    • fibonacci/ - Fibonacci implementations
    • inversion_count/ - Inversion counting
    • lis/ - Longest Increasing Subsequence
    • longest_path/ - Longest path algorithms
    • monotonic_stack/ - Monotonic stack problems
    • tsp/ - Traveling Salesman Problem
  • Cave/ - Interactive cave exploration problem

XMain/ - Utilities and Templates

  • Template.cpp - Main coding template
  • Work.cpp - Working file
  • wtf_sol.cpp - Solution file

Getting Started

  1. Choose a topic from the Knowledge Structure above
  2. Navigate to the appropriate folder in the Folder Structure
  3. Use ALTHEA to convert the code for better readability
  4. Practice and learn from the implementations

Contributing

Feel free to:

  • Report bugs or issues
  • Suggest improvements to existing solutions
  • Add new problems or algorithms
  • Improve code documentation

Resources


This repository serves as both a learning resource and a personal collection of competitive programming solutions. Happy coding!

About

πŸ‘¨β€πŸ’» Competitive Programming Code

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages