Skip to content

liangc001/Competitive-Programming-Solutions

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Competitive Programming Solutions

C++ Algorithms

A comprehensive collection of competitive programming solutions from multiple platforms.

Platforms Covered

Platform Directory Solutions
VJudge /vjudge/ 400+ solutions
Codeforces /Codeforces/ 190+ solutions
Niuke (牛客网) /Niuke/ 170+ solutions

Total Statistics

  • Total Solutions: 800+
  • Total Lines of Code: 20,000+
  • Languages: C++ (primary)
  • Time Period: 2022 - 2023

Repository Structure

.
├── vjudge/                    # VJudge platform solutions
│   ├── 基础算法/              # Basic algorithms
│   ├── 数据结构/              # Data structures
│   ├── 图论/                  # Graph theory
│   ├── 字符串/                # String algorithms
│   ├── 数论/                  # Number theory
│   ├── 搜索2/                 # Search algorithms
│   ├── 贪心/                  # Greedy algorithms
│   └── ...
├── Codeforces/                # Codeforces solutions
│   ├── 10.15/                 # October 15 practice
│   ├── 11.16/                 # November 16 practice
│   └── ...
└── Niuke/                     # Niuke (nowcoder.com) solutions
    ├── 10.17/                 # October 17 practice
    ├── 10.22/                 # October 22 practice
    └── ...

Algorithm Categories

1. Basic Algorithms (基础算法)

  • Sorting and searching
  • Two pointers
  • Prefix sum
  • Difference array

2. Data Structures (数据结构)

  • Stacks and queues
  • Linked lists
  • Trees and BST
  • Heaps and priority queues
  • Disjoint Set Union (DSU)
  • Segment trees

3. Graph Theory (图论)

  • DFS and BFS
  • Shortest path (Dijkstra, Floyd, SPFA)
  • Minimum spanning tree (Prim, Kruskal)
  • Topological sorting
  • Strongly connected components

4. String Algorithms (字符串)

  • KMP pattern matching
  • Trie trees
  • String hashing

5. Number Theory (数论)

  • Prime numbers
  • GCD and LCM
  • Modular arithmetic
  • Fast exponentiation

6. Search Algorithms (搜索)

  • Depth-first search (DFS)
  • Breadth-first search (BFS)
  • Backtracking
  • Pruning techniques

7. Greedy Algorithms (贪心)

  • Activity selection
  • Huffman coding
  • Interval scheduling

How to Use

Compile and Run

# Compile
g++ -std=c++17 -O2 -Wall solution.cpp -o solution

# Run with input file
./solution < input.txt

# Or interactive mode
./solution

Finding Solutions

Solutions are organized by:

  • Platform: vjudge, Codeforces, Niuke
  • Topic: Algorithm categories for VJudge solutions
  • Date: Practice/contest dates for Codeforces and Niuke

Resources

Online Judges

Learning Materials

Code Style

Solutions use standard competitive programming practices:

#include <bits/stdc++.h>
using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    // Solution code

    return 0;
}

Progress Tracking

This repository tracks my competitive programming journey:

  • Started: 2022
  • Platforms: VJudge, Codeforces, Niuke
  • Focus: Algorithm mastery and problem-solving skills

License

This project is licensed under the MIT License - see the LICENSE file for details.

Note

These are personal practice solutions. While I strive for correctness, there may be more optimal solutions available. Please refer to official editorials for best practices.

Contact

For questions or suggestions, please open an issue in this repository.

About

800+ competitive programming solutions from VJudge, Codeforces, and Niuke

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors