mind-sport

active

A comprehensive competitive programming repository containing solutions, algorithms, and data structures for various online judges and programming contests.

C++
1
🍴0
📅Updated July 15, 2025
Tech: C++, Python

Mind-Sport 🧠⚔️

A comprehensive competitive programming repository containing solutions, algorithms, and data structures for various online judges and programming contests.

📁 Repository Structure

🏆 Competitive Programming Platforms

  • AtCoder - Solutions for AtCoder problems (Educational DP Contest and more)
  • CodeChef - Solutions for CodeChef contests and AlgoManiac challenges
  • Codeforces - Solutions for Codeforces problems and contests
  • CSES - Solutions for CSES Problem Set (organized by topic)
  • LeetCode - Solutions for LeetCode problems

📚 Algorithm Library

The Library folder contains optimized implementations of common algorithms and data structures:

🌳 Trees

  • Binary Indexed Tree (Fenwick Tree) - Efficient range sum queries and updates
  • Segment Tree - Range queries with lazy propagation
  • Binary Tree - LCA (Lowest Common Ancestor) implementations
  • N-ary Tree - Tree algorithms for general trees

📊 Graph Algorithms

  • BFS/DFS - Breadth-first and depth-first search
  • Shortest Paths - Dijkstra, Bellman-Ford, Floyd-Warshall
  • Topological Sort - For directed acyclic graphs
  • Connected Components - Finding connected components in graphs

🔄 Dynamic Programming

  • Knapsack Problems - 0/1 Knapsack implementation
  • Digit DP - Dynamic programming on digits
  • Matrix Chain Multiplication - Optimal matrix multiplication order

🔗 Data Structures

  • Disjoint Set Union (DSU) - Union-Find with path compression
  • Sparse Table - For range minimum/maximum queries
  • Hashing - String hashing techniques including Rabin-Karp

🧮 Number Theory

  • GCD/LCM - Greatest common divisor algorithms
  • Modular Arithmetic - Modular exponentiation and operations
  • Prime Factorization - Efficient prime factorization algorithms

📝 String Algorithms

  • KMP (Knuth-Morris-Pratt) - String pattern matching
  • Prefix Function - For string processing
  • Z-Algorithm - Linear time string matching

🔢 Bit Manipulation

  • Efficient bit manipulation techniques and operations

🚀 Getting Started

Template Usage

The repository includes a template.cpp file with:

  • Optimized compiler pragmas for competitive programming
  • Common type definitions and shortcuts
  • Useful macros for faster coding
  • Standard library includes

Running Solutions

Most solutions follow the standard competitive programming format:

  1. Read input from stdin
  2. Process the problem
  3. Write output to stdout

Example compilation and execution:

g++ -o solution solution.cpp
./solution < input.txt

📖 Problem Categories

CSES Problem Set

Organized by topic:

  • Dynamic Programming - Classic DP problems with detailed solutions
  • Graph Algorithms - Comprehensive graph problem solutions
  • String Algorithms - String processing and pattern matching

Contest Solutions

  • AtCoder Educational DP Contest - Complete solutions for the famous DP contest
  • CodeChef Long Challenges - Monthly contest solutions
  • Codeforces Contests - Regular contest participation solutions

🔧 Code Style and Standards

  • Language: Primarily C++ with some Python solutions
  • Coding Style: Consistent with competitive programming standards
  • Optimization: GCC optimization flags enabled for better performance
  • Documentation: Key algorithms include explanatory comments and notes

📝 Notes and Documentation

Many folders contain additional documentation:

  • Algorithm explanations - Detailed explanations for complex algorithms
  • Problem-solving notes - Insights and approaches for different problem types
  • Time/Space complexity - Analysis of algorithm efficiency

🎯 Purpose

This repository serves as:

  • A personal archive of competitive programming solutions
  • A reference library for common algorithms and data structures
  • A learning resource for competitive programming techniques
  • A template repository for contest participation

👤 Author

Author: holdmypotion


"Still building it..." - This repository is continuously updated with new solutions and improvements.

📄 License

This project is open source and available under standard terms for educational and competitive programming purposes.