Solutions and Editorials to problems of CSES.
Introductory Problems
Sorting and Searching
- - Distinct Numbers
- - Apartments
- - Ferris Wheel
- - Concert Tickets
- - Restaurant Customers
- - Movie Festival
- - Sum of Two Values
- - Maximum Subarray Sum
- - Stick Lengths
- - Playlist
- - Towers
- - Traffic Lights
- - Room Allocation
- - Factory Machines
- - Tasks and Deadlines
- - Reading Books
- - Sum of Three Values
- - Sum of Four Values
- - Nearest Smaller Values
- - Subarray Sums I
- - Subarray Sums II
- - Subarray Divisibility
- - Array Division
- - Sliding Median
- - Sliding Cost
- - Movie Festival II
- - Maximum Subarray Sum II
Dynamic Programming
Graph Algorithms
- - Counting Rooms
- - Labyrinth
- - Building Roads
- - Message Route
- - Building Teams
- - Round Trip
- - Monsters
- - Shortest Routes I
- - Shortest Routes II
- - High Score
- - Flight Discount
- - Cycle Finding
- - Flight Routes
- - Round Trip II
- - Course Schedule
- - Longest Flight Route
- - Game Routes
- - Investigation
- - Planets Queries I
- - Planets Queries II
- - Planets Cycles
- - Road Reparation
- - Road Construction
- - Flight Routes Check
- - Planets and Kingdoms
- - Giant Pizza
- - Coin Collector
- - Mail Delivery
- - De Bruijn Sequence
- - Teleporters Path
- - Hamiltonian Flights
- - Knight's Tour
- - Download Speed
- - Police Chase
- - School Dance
- - Distinct Routes
Range Queries
- - Range Sum Queries I
- - Range Minimum Queries I
- - Range Sum Queries II
- - Range Minimum Queries II
- - Range Xor Queries
- - Range Update Queries
- - Forest Queries
- - Hotel Queries
- - List Removals
- - Salary Queries
- - Subarray Sum Queries
- - Distinct Values Queries
- - Forest Queries II
- - Range Updates and Sums
- - Polynomial Queries
- - Range Queries and Copies
Tree Algorithms
Mathematics
- - Exponentiation
- - Exponentiation II
- - Counting Divisors
- - Common Divisors
- - Sum of Divisors
- - Binomial Coefficients
- - Creating Strings II
- - Distributing Apples
- - Christmas Party
- - Fibonacci Numbers
- - Throwing Dice
- - Graph Paths I
- - Graph Paths II
- - Dice Probability
- - Moving Robots
- - Candy Lottery
- - Inversion Probability
- - Stick Game
- - Nim Game I
- - Nim Game II
- - Stair Game
String Algorithms
Additional Problems
- - Shortest Subsequence
- - Counting Bits
- - Swap Game
- - Meet in the Middle
- - Prüfer Code
- - Edge Directions
- - Advertisement
- - Elevator Rides
- - Maximum Xor Subarray
- - Movie Festival Queries
- - Chess Tournament
- - Tree Traversals
- - Network Renovation
- - Graph Girth
- - Intersection Points
- - String Reorder
- - Pyramid Array
- - Increasing Subsequence II
- - String Removals
- - Bit Inversions
- - Writing Numbers
- - String Transform
- - Maximum Building I
- - Sorting Methods
- - Cyclic Array
- - Food Division
- - Bit Problem
- - Swap Round Sorting
- - Tree Isomorphism I
- - Critical Cities
- - School Excursion
- - Coin Grid
- - Robot Path
- - Course Schedule II
- - Empty String
- - Grid Paths
- - Book Shop II
- - Network Breakdown
- - Visiting Cities
- - Number Grid
- - Maximum Building II
- - Stick Divisions
- - Coding Company
- - Flight Route Requests
- - Tree Isomorphism II
- - Forbidden Cities
- - Area of Rectangles
- - Creating Offices
- - Permutations II
- - New Flight Routes
Everyone is requested to either comment their code properly or use appropriate variable and function names throughout the code.
This repo is created to house the solutions and editorials of problems of CSES at one place. CSES contains 200 problems from beginner to advanced levels.
The CSES Problem Set contains a collection of competitive programming practice problems. You can access the problems here.
Read the Contributing.md file for this. All the contributions should follow the guidelines.
Contributions are accepted only in the following languages:
- Assembly
- C++
- Haskell
- Java
- Node.js
- Pascal
- Python2
- Python3
- Ruby
- Rust
- Scala
If you are new to Open source or github. You can follow this wonderful guide to learn more about it.
Keep Learning with Open Source