Skip to content

Latest commit

 

History

History
258 lines (209 loc) · 20.2 KB

File metadata and controls

258 lines (209 loc) · 20.2 KB

Competitive Programming

This repository contains my solutions to competitive programming problems solved on various online judges.

The structure of the repository is simple: each folder is named according to the corresponding online judge, and the solution files are organized by the problem name, with links to the original sources.

Additionally, most problems are mapped by topic and can be easily accessed in the Problem Set.

I have categorized the problems as easy, medium, or hard based on my own perspective. While these classifications are subjective, they aim to reflect the effort and thought required to solve each problem. Sometimes, a problem that could be tagged as easy is actually medium or hard, as it involves recognizing properties that may not be immediately obvious.

Judges

This repository contains solutions from the following online judges:

Contests

Problem Set


Binary Search

Problem Category Difficulty
Binary Search Array Search 🟢 Easy
Closest to the left Array Search 🟢 Easy
Closest to the right Array Search 🟢 Easy
Fast Search Array Search 🔵 Medium
Truck Driver Lower/Upper Bound 🔵 Medium
Interesting drink Search for Valid Answers 🟢 Easy
Packing Rectangles Search for Valid Answers 🟢 Easy
Very Easy Task Search for Valid Answers 🟢 Easy
Students Councils Search for Valid Answers 🔵 Medium
Magic Powder - 1 Search for Valid Answers 🔵 Medium
Children Holiday Search for Valid Answers 🔴 Hard
String Game Search for Valid Answers 🔴 Hard
Hamburguer Search for Valid Answers 🔴 Hard
Ropes Search with Real Numbers 🟢 Easy
Equation Search with Real Numbers 🔵 Medium
Solve it! Search with Real Numbers 🔴 Hard
Get together Minmax 🟢 Easy
Splitting an Array Minmax 🟢 Easy
March Rain Minmax 🔵 Medium
Cows in Stalls Minmax 🔵 Medium
Minimum maximum on the Path Minmax 🔴 Hard
Maximum Average Segment Maximum Average 🟢 Easy
Pair Selection Maximum Average 🟢 Easy
Minimum Average Path Minimum Average 🔴 Hard
K-th Number in the Union of Segments Finding the K-th Element 🟢 Easy
Multiplication Table Finding the K-th Element 🔵 Medium
K-th Sum Finding the K-th Element 🔵 Medium

Bitmask

Problem Category Difficulty
Bit Operation I Bit Manipulation 🟢 Easy
Bit Operation II Bit Manipulation 🟢 Easy
Bit Flag Bit Manipulation 🟢 Easy
Bit Mask Bit Manipulation 🟢 Easy
XOR World Bit Manipulation 🟢 Easy
Serval and The Formula Bit Manipulation 🟢 Easy
Bits Bit Manipulation 🔵 Medium
XOR Guessing Bit Manipulation 🔵 Medium
Enumeration of Subsets I Submask Enumeration 🟢 Easy
Enumeration of Subsets II Submask Enumeration 🟢 Easy
Enumeration of Subsets III Submask Enumeration 🟢 Easy
Enumeration of Combinations Submask Enumeration 🟢 Easy
Little Girl and Maximum XOR Greedy 🔵 Medium
And Or Greedy 🔵 Medium
XOR Emergence Dynamic programming 🟢 Easy
Hackers' Crackdown Dynamic programming 🔵 Medium

Brute Force

Problem Category Difficulty
Coprime Number Theory 🟢 Easy
250 Thousand Tons of TNT Number Theory 🟢 Easy
Perfect Number Greedy 🟢 Easy

Data Structures

Problem Category Difficulty
Bad Sequence Greedy 🟢 Easy
Uniqueness Greedy 🟢 Easy
Cumulative Sum Query Prefix Sums/BIT/Segtree 🟢 Easy
Potentiometers BIT/Segtree 🟢 Easy
Inversion Count BIT/Segtree 🟢 Easy
Curious Robin Hood BIT/Segtree 🟢 Easy
Points in Rectangle BIT2D/Segtree2D 🟢 Easy
Card Trick BIT + K-th 🔵 Medium
Sliding Window Minimum Minimum Queue 🟢 Easy
Queries with Fixed Length Minimum Queue 🟢 Easy
Nearest Smaller Values Monotonic Stack 🟢 Easy
Advertisement Monotonic Stack 🔵 Medium
Minimum Sum Monotonic Stack 🔵 Medium
Sum of Subarray Minimums Monotonic Stack 🔴 Hard
Imbalanced Array Monotonic Stack 🔵 Medium
Static Range Minimum Queries Sparse Table 🟢 Easy
Maximum modulo equality Sparse Table 🟢 Easy
Iva & Pav Sparse Table 🟢 Easy

Disjoint Sets Union

Problem Category Difficulty
Disjoint Sets Union Disjoint Sets Union 🟢 Easy
Disjoint Sets Union 2 Disjoint Sets Union 🟢 Easy
Experience Disjoint Sets Union 🔵 Medium
War Disjoint Sets Union 🔴 Hard
Cutting a graph Offline Deletion 🔵 Medium
Anansi's Cobweb Offline Deletion 🔵 Medium
People are leaving Merge Segments 🟢 Easy
Parking Merge Segments 🟢 Easy
Restructuring Company Merge Segments 🔵 Medium

Dynamic Programming

Problem Category Difficulty
Robot Customize Knapsack Variation 🟢 Easy
Book Shop Knapsack 🟢 Easy
Minimizing Coins Min DP 🟢 Easy
Removing Digits Min DP 🟢 Easy
Dice Combinations Arrangement Count 🟢 Easy
Coin Combinations I Arrangement Count 🟢 Easy
Coin Combinations II Combination Count 🟢 Easy
Grid Paths I Upper/Left DP on Grid 🟢 Easy
Array Description Propagation DP 🟢 Easy
Counting Towers Propagation DP 🟢 Easy
Edit Distance Top Down DP 🟢 Easy
Longest Common Subsequence Top Down DP 🟢 Easy

Graphs

Problem Category Difficulty
Coronavirus Spread BFS 🟢 Easy

Math

Problem Category Difficulty
Buy a Shovel Implementation 🟢 Easy
Is your horseshoe on the other hoof? Implementation 🟢 Easy
Young Physicist Implementation 🟢 Easy
Shell Game Implementation 🟢 Easy
Expression Brute Force 🟢 Easy
Removal of a Sequence (Hard Version) Implementation + Number Theory 🔴 Hard

Number Theory

Problem Category Difficulty
Lucky Division Brute Force 🟢 Easy
2^a b^2 Implementation 🟢 Easy
Medium Factorization Prime Factorization 🟢 Easy
Simple Repetition Prime Factorization 🟢 Easy
Ringo's Favorite Numbers 3 Prime Factorization 🟢 Easy
Soldier and Number Game Prime Factorization 🔵 Medium
Simple Sum Prime Factorization 🔴 Hard

Prefix Sums

Problem Category Difficulty
Find Pivot Index Target Sum 🟢 Easy
Subarray Sums II Target Sum 🟢 Easy
Subarray Divisibility Target Divisibility 🟢 Easy
Forest Queries 2D Prefix Sums 🟢 Easy

Two Pointers Method

Problem Category Difficulty
Merging Arrays Two Pointers Method 🟢 Easy
Number of Smaller Two Pointers Method 🟢 Easy
Number of Equal Two Pointers Method 🟢 Easy
Counting Kangaroos is Fun Two Pointers Method 🟢 Easy
Subarray Sums I Segment with good sum 🟢 Easy
Books Segment with good sum 🟢 Easy
Segment with Big Sum Segment with good sum 🟢 Easy
Number of Segments with Small Sum Segment with good sum 🟢 Easy
Number of Segments with Big Sum Segment with good sum 🟢 Easy

Strings

Problem Category Difficulty
String Task Implementation 🟢 Easy
ABCBA Implementation 🟢 Easy
Chat room Greedy 🟢 Easy
Lucky Substring Brute Force 🟢 Easy