Codeforces problemset search & solutions
Exclude tags.

Review the problem statement from Codeforces (link will open a new tab). When you've matched your problem, go to the solutions.

Search on plain tags, ratings, names, and problem text. Example: brute force or binary search

< 1 2

Solved
Name
Tags
Solutions
Index
Contest
Type
Points
Tutorial
Rating Level
5666 Set To Max (Hard Version) binary search constructive algorithms data structures dsu greedy implementation sortings two pointers Statement D2 Codeforces Round 914 (Div. 2) {1904} PROGRAMMING 750.0 Codeforces Round 914 (Div. 2) Editorial
14175 Largest Subsequence data structures greedy strings Statement C Codeforces Round 915 (Div. 2) {1905} PROGRAMMING 1500.0 Codeforces Round 915 (Div. 2) Editorial
23083 Removal of Unattractive Pairs constructive algorithms greedy math strings Statement C Codeforces Round 913 (Div. 3) {1907} PROGRAMMING Codeforces Round 913 (Div. 3) Editorial
34259 Romantic Glasses data structures greedy math Statement E Codeforces Round 918 (Div. 4) {1915} PROGRAMMING 123952
34985 Unnatural Language Processing dp greedy implementation strings Statement D Codeforces Round 918 (Div. 4) {1915} PROGRAMMING 123952
32546 Sending Messages greedy math Statement C Codeforces Round 920 (Div. 3) {1921} PROGRAMMING Editorial for Codeforces Round 920 (Div. 3)
533 Shrink-Reverse binary search greedy string suffix structures strings Statement F Educational Codeforces Round 162 (Rated for Div. 2) {1923} PROGRAMMING Educational Codeforces Round 162 Editorial
19836 Monsters Attack! dp greedy implementation Statement B Educational Codeforces Round 162 (Rated for Div. 2) {1923} PROGRAMMING Educational Codeforces Round 162 Editorial
16681 Did We Get Everything Covered? constructive algorithms dp greedy strings Statement A Codeforces Round 921 (Div. 1) {1924} PROGRAMMING 500.0 Codeforces Round 921 (Div. 1, Div. 2) Editorial
31114 We Got Everything Covered! constructive algorithms greedy strings Statement A Codeforces Round 921 (Div. 2) {1925} PROGRAMMING 500.0 Codeforces Round 921 (Div. 1, Div. 2) Editorial
31497 Choose the Different Ones! brute force greedy math Statement C Codeforces Round 923 (Div. 3) {1927} PROGRAMMING 125597
37987 Following the String constructive algorithms greedy strings Statement B Codeforces Round 923 (Div. 3) {1927} PROGRAMMING 125597
51264 Make it White greedy strings Statement A Codeforces Round 923 (Div. 3) {1927} PROGRAMMING 125597
2088 Modular Sequence constructive algorithms dp greedy implementation math number theory Statement E Codeforces Round 924 (Div. 2) {1928} PROGRAMMING 2250.0 Codeforces Round 924 Editorial
24396 Rectangle Cutting constructive algorithms geometry greedy math Statement A Codeforces Round 924 (Div. 2) {1928} PROGRAMMING 500.0 Codeforces Round 924 Editorial
17241 Sasha and the Casino binary search brute force dp games greedy math Statement C Codeforces Round 926 (Div. 2) {1929} PROGRAMMING 1500.0 Codeforces Round #926 (Div. 2) Editorial.
4843 Sum over all Substrings (Easy Version) brute force dp greedy strings Statement D1 think-cell Round 1 {1930} PROGRAMMING 1250.0 think-cell Round 1 Editorial
3044 Sum over all Substrings (Hard Version) dp greedy strings Statement D2 think-cell Round 1 {1930} PROGRAMMING 1000.0 think-cell Round 1 Editorial
23455 Turtle Tenacity: Continual Mods constructive algorithms greedy number theory sortings Statement D Codeforces Round 929 (Div. 3) {1933} PROGRAMMING Codeforces Round 929 (Div. 3) Editorial
17284 Binary Path greedy implementation Statement B Codeforces Round 930 (Div. 2) {1937} PROGRAMMING 1000.0 Codeforces Round 930 (Div. 1, Div. 2) Editorial
34665 Rudolf and 121 greedy math Statement B Codeforces Round 933 (Div. 3) {1941} PROGRAMMING 127018
4466 No Palindromes brute force constructive algorithms greedy hashing implementation strings Statement E Codeforces Global Round 25 {1951} PROGRAMMING 2250.0 Codeforces Global Round 25 Editorial
2344 Folding Strip constructive algorithms greedy strings Statement C Codeforces Round 941 (Div. 1) {1965} PROGRAMMING 1500.0 Codeforces Round #941 (Div. 1, Div. 2) Editorial 2300
31351 Prefiquence greedy two pointers Statement B Codeforces Round 943 (Div. 3) {1968} PROGRAMMING 129096 800
30478 Binary Cut dp greedy implementation sortings strings Statement D Codeforces Round 944 (Div. 4) {1971} PROGRAMMING Codeforces Round 944 (Div. 4) Editorial 1100
21014 378QAQ and Mocha's Array brute force greedy math sortings Statement B Codeforces Round 947 (Div. 1 + Div. 2) {1975} PROGRAMMING 500.0 editorial_zh.pdf 1000
339 Zimpha Fan Club fft greedy math strings Statement G Codeforces Round 947 (Div. 1 + Div. 2) {1975} PROGRAMMING 3000.0 editorial_zh.pdf 3000
216 378QAQ and Core greedy strings Statement H Codeforces Round 947 (Div. 1 + Div. 2) {1975} PROGRAMMING 4500.0 editorial_zh.pdf 3500
20673 Bazoka and Mocha's Array brute force greedy implementation sortings Statement A Codeforces Round 947 (Div. 1 + Div. 2) {1975} PROGRAMMING 250.0 editorial_zh.pdf 800
17750 Manhattan Permutations constructive algorithms greedy implementation math Statement C Codeforces Round 953 (Div. 2) {1978} PROGRAMMING 1250.0 130527
4593 Computing Machine data structures dp greedy implementation Statement E Codeforces Round 953 (Div. 2) {1978} PROGRAMMING 2000.0 130527
7833 Fixing a Binary String bitmasks brute force constructive algorithms greedy hashing strings Statement D Codeforces Round 951 (Div. 2) {1979} PROGRAMMING 2000.0 Codeforces Round 951 (Div. 2) Editorial
17321 GCD-sequence greedy implementation math math number theory number theory Statement D Codeforces Round 950 (Div. 3) {1980} PROGRAMMING 130135
27468 Soccer greedy implementation math sortings Statement A Codeforces Round 955 (Div. 2, with prizes from NEAR!) {1982} PROGRAMMING 500.0 130839
11001 Swap Dilemma constructive algorithms divide and conquer greedy math sortings Statement D Codeforces Round 956 (Div. 2) and ByteRace 2024 {1983} PROGRAMMING 1750.0
18365 Corner Twist constructive algorithms greedy implementation math Statement B Codeforces Round 956 (Div. 2) and ByteRace 2024 {1983} PROGRAMMING 1000.0
23267 Substring and Subsequence bitmasks brute force dp graphs greedy hashing strings trees Statement B Educational Codeforces Round 167 (Rated for Div. 2) {1989} PROGRAMMING Educational Codeforces Round 167 Editorial
26792 Submission Bait brute force games greedy sortings Statement A Codeforces Round 960 (Div. 2) {1990} PROGRAMMING 500.0 Video Tutorial
2770 Triangle Formation brute force greedy math sortings Statement F Pinely Round 4 (Div. 1 + Div. 2) {1991} PROGRAMMING 2500.0 Video Tutorial
23931 Test of Love dp greedy implementation Statement D Codeforces Round 957 (Div. 3) {1992} PROGRAMMING Shayan's Video Tutorial
19429 Fun Game bitmasks constructive algorithms greedy math Statement B Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) {1994} PROGRAMMING 1000.0 Video Tutorial
7349 Funny Game constructive algorithms dsu graphs greedy math number theory Statement D Codeforces Round 959 sponsored by NEAR (Div. 1 + Div. 2) {1994} PROGRAMMING 2000.0 Video Tutorial
2877 Cases bitmasks brute force combinatorics dfs and similar dp graphs greedy strings Statement D Codeforces Round 961 (Div. 2) {1995} PROGRAMMING 2250.0 Video Tutorial
32583 Slavic's Exam greedy implementation strings Statement D Codeforces Round 964 (Div. 4) {1999} PROGRAMMING Video Tutorial
17655 Black Circles brute force constructive algorithms geometry greedy math Statement C EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) {2002} PROGRAMMING 1000.0 EPIC Institute of Technology Round August 2024 (Div. 1 + Div. 2) Editorial
21589 Turtle and Good Pairs constructive algorithms greedy strings Statement C Codeforces Round 968 (Div. 2) {2003} PROGRAMMING 1000.0 sol-zh.pdf
32606 Turtle and Good Strings greedy strings Statement A Codeforces Round 968 (Div. 2) {2003} PROGRAMMING 500.0 sol-zh.pdf
13205 Colored Portals binary search data structures graphs greedy shortest paths Statement D Educational Codeforces Round 169 (Rated for Div. 2) {2004} PROGRAMMING Educational Codeforces Round 169 Editorial
9292 Iris and Game on the Tree games graphs greedy trees Statement A Codeforces Round 969 (Div. 1) {2006} PROGRAMMING 750.0 Tutorial
41681 Sakurako's Exam brute force constructive algorithms greedy math Statement A Codeforces Round 970 (Div. 3) {2008} PROGRAMMING Codeforces Round 970 (Div. 3) Editorial
13131 Alternating String brute force data structures dp greedy strings Statement E Codeforces Round 970 (Div. 3) {2008} PROGRAMMING Codeforces Round 970 (Div. 3) Editorial
182 Rock-Paper-Scissors Bot *special greedy strings Statement E Kotlin Heroes: Episode 11 {2011} PROGRAMMING Kotlin Heroes 11 — Editorial
1369 C+K+S brute force constructive algorithms dfs and similar graphs greedy hashing math strings Statement C Codeforces Round 980 (Div. 1) {2023} PROGRAMMING 1500.0 135341
28484 Two Screens binary search greedy strings two pointers Statement A Educational Codeforces Round 170 (Rated for Div. 2) {2025} PROGRAMMING Educational Codeforces Round 170 Editorial
11692 Replacement games greedy strings Statement B Refact.ai Match 1 (Codeforces Round 985) {2029} PROGRAMMING 1250.0 Refact.ai Match 1 (Codeforces Round 985) Editorial
1155 Orangutan Approved Subarrays binary search brute force data structures greedy two pointers Statement F Codeforces Round 979 (Div. 2) {2030} PROGRAMMING 2500.0 Codeforces Round 979 Editorial
2015 Permutations Harmony brute force combinatorics constructive algorithms greedy hashing implementation math Statement E Rayan Programming Contest 2024 - Selection (Codeforces Round 989, Div. 1 + Div. 2) {2034} PROGRAMMING 2000.0 Rayan 2024 Selection Round Editorial
7349 Kachina's Favorite Binary String greedy interactive two pointers Statement E Codeforces Round 988 (Div. 3) {2037} PROGRAMMING Video Tutorial
17241 Shohag Loves Strings constructive algorithms greedy implementation strings Statement B CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!) {2039} PROGRAMMING 1000.0 Editorial of CodeTON Round 9 (Div. 1 + Div. 2)
7162 Saraga greedy strings Statement C 2024-2025 ICPC Asia Jakarta Regional Contest (Unrated, Online Mirror, ICPC Rules, Teams Preferred) {2045} PROGRAMMING raRzKDJLPHcUnqTcwvGznwEdKiDWjEkd.pdf 1400
19188 Replace Character brute force combinatorics greedy strings Statement B Codeforces Round 990 (Div. 2) {2047} PROGRAMMING 1000.0 Разбор Codeforces Round 990 (Div. 2 + Div. 1)
15081 Kevin and Binary Strings bitmasks brute force greedy strings Statement C Codeforces Global Round 28 {2048} PROGRAMMING 1000.0 Tutorial
18894 Digital string maximization brute force greedy math strings Statement D Codeforces Round 991 (Div. 3) {2050} PROGRAMMING Разбор Codeforces Round 991 (Div. 3)
224 Naive String Splits brute force greedy hashing strings Statement G Good Bye 2024: 2025 is NEAR {2053} PROGRAMMING 4250.0 Good Bye 2024: 2025 is NEAR Editorial
1280 Bugged Sort dp greedy sortings Statement G Codeforces Round 998 (Div. 3) {2060} PROGRAMMING Codeforces Round 998 (Div. 3) Editorial
2259 Kevin and Binary String (Easy Version) binary search brute force data structures dp greedy implementation strings two pointers Statement F1 IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) {2061} PROGRAMMING 2000.0 IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) Editorial
10709 Kevin and Numbers brute force data structures greedy implementation math Statement D IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) {2061} PROGRAMMING 1500.0 IAEPC Preliminary Contest (Codeforces Round 999, Div. 1 + Div. 2) Editorial
28218 String greedy strings Statement A Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2) {2062} PROGRAMMING 500.0 Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2) Editorial
27016 Brogramming Contest greedy strings Statement A Codeforces Round 1005 (Div. 2) {2064} PROGRAMMING 500.0 Codeforces Round 1005 (Div. 2) Editorial
1472 Mascot Naming brute force greedy strings Statement F European Championship 2025 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) {2068} PROGRAMMING 140239
7000 Palindrome Shuffle binary search greedy hashing strings two pointers Statement D Educational Codeforces Round 174 (Rated for Div. 2) {2069} PROGRAMMING 139774
1893 A, B, AB and BA constructive algorithms greedy sortings strings Statement E Educational Codeforces Round 174 (Rated for Div. 2) {2069} PROGRAMMING 139774
1834 Game with Binary String data structures divide and conquer games greedy math Statement E Educational Codeforces Round 175 (Rated for Div. 2) {2070} PROGRAMMING Video Tutorial
23245 Final Verdict greedy math Statement A Codeforces Round 1008 (Div. 2) {2078} PROGRAMMING 500.0 Codeforces Round 1008 (Div. 1, Div. 2) Editorial
16506 MIN = GCD greedy math Statement B Teza Round 1 (Codeforces Round 1015, Div. 1 + Div. 2) {2084} PROGRAMMING 1000.0 141155
38818 Olympiad Date greedy strings Statement A Codeforces Round 1013 (Div. 3) {2091} PROGRAMMING Codeforces Round 1013 (Div. 3) Editorial
6827 Mishkin Energizer brute force constructive algorithms greedy implementation strings Statement D Codeforces Round 1014 (Div. 2) {2092} PROGRAMMING 1750.0 Codeforces Round #1014 (Div. 2) Editorial
428 Andryusha and CCB brute force constructive algorithms greedy math number theory strings Statement F Codeforces Round 1014 (Div. 2) {2092} PROGRAMMING 3000.0 Codeforces Round #1014 (Div. 2) Editorial
3770 Shorten the Array binary search brute force data structures dfs and similar greedy strings trees two pointers Statement G Codeforces Round 1016 (Div. 3) {2093} PROGRAMMING Codeforces Round 1016 (Div. 3) Editorial
23743 Tung Tung Sahur greedy strings two pointers Statement D Codeforces Round 1017 (Div. 4) {2094} PROGRAMMING Codeforces Round 1017 (Div. 4) Editorial
17611 Binary Typewriter greedy math Statement B Codeforces Round 1019 (Div. 2) {2103} PROGRAMMING 1000.0 142149
8005 Unpleasant Strings binary search data structures dp greedy strings Statement E Educational Codeforces Round 178 (Rated for Div. 2) {2104} PROGRAMMING Educational Codeforces Round 178 Editorial
4402 Goblin dp dsu greedy math Statement F Codeforces Round 1020 (Div. 3) {2106} PROGRAMMING Codeforces Round 1020 (Div. 3) Editorial
5391 Changing the String binary search data structures greedy implementation sortings strings Statement E Educational Codeforces Round 179 (Rated for Div. 2) {2111} PROGRAMMING Educational Codeforces Round 179 Editorial
30400 Not Quite a Palindromic String greedy greedy math math Statement B Codeforces Round 1027 (Div. 3) {2114} PROGRAMMING 143268
37829 False Alarm greedy implementation Statement A Codeforces Round 1029 (Div. 3) {2117} PROGRAMMING Codeforces Round 1029 (Div. 3) Editorial
18170 Line Segments geometry greedy math Statement B Codeforces Round 1035 (Div. 2) {2119} PROGRAMMING 1000.0 Codeforces Round 1035 (Div. 2) Editorial
32415 Above the Clouds constructive algorithms greedy strings Statement B Codeforces Round 1032 (Div. 3) {2121} PROGRAMMING Codeforces Round 1032 (Div. 3) Editorial
14597 Sponsor of Your Problems greedy strings Statement E Codeforces Round 1032 (Div. 3) {2121} PROGRAMMING Codeforces Round 1032 (Div. 3) Editorial
8046 Make a Palindrome greedy sortings Statement D EPIC Institute of Technology Round Summer 2025 (Codeforces Round 1036, Div. 1 + Div. 2) {2124} PROGRAMMING 1750.0 EPIC Institute of Technology Round Summer 2025 (Codeforces Round 1036, Div. 1 + Div. 2) Editorial
19570 Mix Mex Max constructive algorithms greedy math Statement A Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) {2127} PROGRAMMING 500.0 Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial
4699 Unjust Binary Life binary search binary search data structures greedy greedy math two pointers Statement F Codeforces Round 1042 (Div. 3) {2131} PROGRAMMING Codeforces Round 1042 (Div. 3) Editorial
26012 In the Dream greedy math Statement A Codeforces Round 1046 (Div. 2) {2136} PROGRAMMING 500.0 Codeforces Round 1046 (Div. 1, Div. 2) Editorial
22167 Shift Sort greedy sortings strings Statement A Codeforces Round 1049 (Div. 2) {2140} PROGRAMMING 500.0 Codeforces Round 1049 (Div. 2) Editorial
15303 Monocarp's String binary search greedy strings Statement C Educational Codeforces Round 183 (Rated for Div. 2) {2145} PROGRAMMING Educational Codeforces Round 183 Editorial
15828 Merging the Sets greedy implementation Statement B Codeforces Round 1052 (Div. 2) {2146} PROGRAMMING 1000.0 Codeforces Round 1052 (Div. 2) Editorial
9658 Rabbits 2-sat dp graphs greedy implementation Statement C Codeforces Global Round 29 (Div. 1 + Div. 2) {2147} PROGRAMMING 1500.0
4917 Copy String binary search greedy implementation strings Statement D Codeforces Global Round 30 (Div. 1 + Div. 2) {2164} PROGRAMMING 1750.0 Codeforces Global Round 30 Editorial
11420 Rae Taylor and Trees (easy version) binary search data structures dp dsu greedy implementation trees Statement D Codeforces Round 1065 (Div. 3) {2171} PROGRAMMING Codeforces Round 1065 (Div. 3) Editorial
14103 Needle in a Haystack greedy strings two pointers Statement A Codeforces Round 1069 (Div. 1) {2174} PROGRAMMING 500.0 Codeforces Round 1069 Editorial
22733 Optimal Shifts bitmasks greedy strings Statement B Codeforces Round 1070 (Div. 2) {2176} PROGRAMMING 1000.0 Codeforces Round 1070 (Div.2) Editorial
25498 Yes or Yes brute force greedy strings Statement A Good Bye 2025 {2178} PROGRAMMING 500.0
21455 Impost or Sus greedy implementation strings Statement B Good Bye 2025 {2178} PROGRAMMING 750.0
24451 Ashmal greedy strings Statement B Codeforces Global Round 31 (Div. 1 + Div. 2) {2180} PROGRAMMING 750.0 Codeforces Global Round 31
25141 New Year String greedy implementation strings Statement A Educational Codeforces Round 186 (Rated for Div. 2) {2182} PROGRAMMING Educational Codeforces Round 186 Editorial
1906 Little String (Hard Version) binary search combinatorics dp greedy math number theory Statement D2 Codeforces Round 1075 (Div. 2) {2189} PROGRAMMING 750.0 Codeforces Round 1075 (Div. 2) Editorial
808 Majority Wins? dp greedy math strings Statement E Codeforces Round 1075 (Div. 2) {2189} PROGRAMMING 2500.0 Codeforces Round 1075 (Div. 2) Editorial
10510 Sub-RBS (Easy Version) combinatorics constructive algorithms dp greedy strings two pointers Statement B1 Codeforces Round 1073 (Div. 1) {2190} PROGRAMMING 750.0 Codeforces Round 1073 (Div. 1, Div. 2) Editorial
2002 Swap to Rearrange constructive algorithms dfs and similar graph matchings graphs greedy strings Statement E Codeforces Round 1081 (Div. 2) {2192} PROGRAMMING 2250.0 Codeforces Round 1081 (Div. 2) Editorial
1024 Remove the Grail Tree dfs and similar dp greedy trees Statement H Codeforces Round 1076 (Div. 3) {2193} PROGRAMMING Разбор Codeforces Round 1076 (Div. 3)
274 Fuzzy Concatenation (Easy Version) binary search bitmasks brute force data structures greedy string suffix structures Statement E1 Codeforces Round 1079 (Div. 1) {2196} PROGRAMMING 2000.0 Tutorial
192 Fuzzy Concatenation (Hard version) binary search data structures dp greedy string suffix structures Statement E2 Codeforces Round 1079 (Div. 1) {2196} PROGRAMMING 1000.0 Tutorial
20883 Specialty String brute force greedy strings Statement C Codeforces Round 1084 (Div. 3) {2200} PROGRAMMING Codeforces Round 1084 (Div. 3) Editorial
10817 ABAB Construction greedy implementation Statement B Codeforces Round 1082 (Div. 2) {2202} PROGRAMMING 1250.0 Codeforces Round 1082 (Div. 1, Div. 2) Complete Editorial
13240 1-1 greedy strings Statement A Codeforces Round 1085 (Div. 1 + Div. 2) {2207} PROGRAMMING 750.0 Codeforces Round 1085 (Div. 1 + Div. 2) Editorial