Skip to content

Latest commit

 

History

History
1460 lines (1394 loc) · 38.2 KB

File metadata and controls

1460 lines (1394 loc) · 38.2 KB

CSES Solutions

Accepted solutions of CSES problemset.

Table of Contents


Advanced Techniques

Problem ID Solution Code Problem Statement
1628 💻 Meet in the Middle 📜 Statement
2136 💻 Hamming Distance 📜 Statement

Dynamic Programming

Problem ID Solution Code Problem Statement
1097 💻 Removal Game 📜 Statement
1158 💻 Book Shop 📜 Statement
1633 💻 Dice Combinations 📜 Statement
1634 💻 Minimizing Coins 📜 Statement
1635 💻 Coin Combinations I 📜 Statement
1636 💻 Coin Combinations II 📜 Statement
1637 💻 Removing Digits 📜 Statement
1638 💻 Grid Paths 📜 Statement
1745 💻 Money Sums 📜 Statement
1746 💻 Array Description 📜 Statement

Geometry

Problem ID Solution Code Problem Statement
2189 💻 Point Location Test 📜 Statement
2190 💻 Line Segment Intersection 📜 Statement
2191 💻 Polygon Area 📜 Statement
2192 💻 Point in Polygon 📜 Statement
2193 💻 Polygon Lattice Points 📜 Statement
2195 💻 Convex Hull 📜 Statement

Graph Algorithms

Problem ID Solution Code Problem Statement
1149 💻 Monsters 📜 Statement
1192 💻 Coutning Rooms 📜 Statement
1193 💻 Labyrinth 📜 Statement
1666 💻 Building Roads 📜 Statement
1667 💻 Message Route 📜 Statement
1668 💻 Building Teams 📜 Statement
1669 💻 Round Trip 📜 Statement
1671 💻 Shortest Routes I 📜 Statement
1672 💻 Shortest Routes II 📜 Statement

Introductory Problems

Problem ID Solution Code Problem Statement
1069 💻 Repetitions 📜 Statement
1072 💻 Two Knights 📜 Statement
1083 💻 Missing Number 📜 Statement
1086 💻 Weird Algorithm 📜 Statement
1092 💻 Two Sets 📜 Statement
1094 💻 Increasing Array 📜 Statement
1617 💻 Bit Strings 📜 Statement
1618 💻 Trailing Zeros 📜 Statement
1754 💻 Coin Piles 📜 Statement
1755 💻 Palindrome Reorder 📜 Statement
2205 💻 Gray Code 📜 Statement
2431 💻 Digit Queries 📜 Statement

Mathematics

Problem ID Solution Code Problem Statement
1081 💻 Common Divisors 📜 Statement
1082 💻 Sum of Divisors 📜 Statement
1095 💻 Exponentiation 📜 Statement
1712 💻 Exponentiation II 📜 Statement
1713 💻 Counting Divisors 📜 Statement
1716 💻 Distributing Apples 📜 Statement
2182 💻 Divisor Analysis 📜 Statement
2185 💻 Prime Multiples 📜 Statement

Range Queries

Problem ID Solution Code Problem Statement
1143 💻 Hotel Queries 📜 Statement
1646 💻 Static Range Sum Queries 📜 Statement
1647 💻 Static Range Minimum Queries 📜 Statement
1648 💻 Dynamic Range Sum Queries 📜 Statement
1649 💻 Dynamic Range Minimum Queries 📜 Statement
1650 💻 Range Xor Queries 📜 Statement
1651 💻 Range Update Queries 📜 Statement
1749 💻 List Removals 📜 Statement

Sorting and Searching

Problem ID Solution Code Problem Statement
1073 💻 Towers 📜 Statement
1074 💻 Stick Lengths 📜 Statement
1084 💻 Apartments 📜 Statement
1090 💻 Ferris Wheel 📜 Statement
1091 💻 Concert Tickets 📜 Statement
1141 💻 Playlist 📜 Statement
1164 💻 Room Allocation 📜 Statement
1619 💻 Restaurant Customers 📜 Statement
1621 💻 Distinct Numbers 📜 Statement
1629 💻 Movie Festival 📜 Statement
1640 💻 Sum of Two Values 📜 Statement
1643 💻 Maximum Subarray Sum 📜 Statement
2162 💻 Josephus Problem I 📜 Statement
2168 💻 Nested Ranges Check 📜 Statement
2183 💻 Missing Coin Sum 📜 Statement
2216 💻 Collecting Numbers 📜 Statement

String Algorithms

Problem ID Solution Code Problem Statement
1731 💻 Word Combinations 📜 Statement
1732 💻 Finding Borders 📜 Statement
1733 💻 Finding Periods 📜 Statement
1753 💻 String Matching 📜 Statement
2102 💻 Finding Patterns 📜 Statement

Tree Algorithms

Problem ID Solution Code Problem Statement
1131 💻 Tree Diameter 📜 Statement
1132 💻 Tree Distances I 📜 Statement
1135 💻 Distance Queries 📜 Statement
1136 💻 Counting Paths 📜 Statement
1139 💻 Distinct Colors 📜 Statement
1674 💻 Subordinates 📜 Statement
1687 💻 Company Queries I 📜 Statement
1688 💻 Company Queries II 📜 Statement