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

Solved
Name
Tags
Solutions
Index
Contest
Type
Points
Tutorial
Rating Level
17984 Longest Regular Bracket Sequence constructive algorithms data structures dp greedy sortings strings Statement C Codeforces Beta Round 5 {5} PROGRAMMING C, D и E с CBR5 - разбор 1900
2719 Queue constructive algorithms greedy sortings Statement C Codeforces Round 101 (Div. 2) {141} PROGRAMMING Codeforces Round #101 (Div. 2) Разбор Задач. 1800
2084 Discounts constructive algorithms greedy sortings Statement B VK Cup 2012 Round 1 {161} PROGRAMMING VK Cup 2012 Round 1: editorial 1700
10216 Buggy Sorting constructive algorithms greedy sortings Statement A Codeforces Round 151 (Div. 2) {246} PROGRAMMING Codeforces Round #151 (Div. 2) Tutorial 1000
5933 Ilya and Matrix constructive algorithms greedy implementation sortings Statement C Codeforces Round 186 (Div. 2) {313} PROGRAMMING Tutorial 1400
2430 Two Heaps combinatorics constructive algorithms greedy implementation math sortings Statement B Codeforces Round 205 (Div. 2) {353} PROGRAMMING 9145 1800
1714 Mittens constructive algorithms greedy sortings Statement C Codeforces Round 217 (Div. 2) {370} PROGRAMMING Codeforces Round #217 (Div. 2): tutorial 1800
8420 Towers brute force constructive algorithms greedy implementation sortings Statement B Codeforces Round 274 (Div. 2) {479} PROGRAMMING Codeforces Round #274: editorial 1400
6054 Misha and Forest constructive algorithms data structures greedy sortings trees Statement C Codeforces Round 285 (Div. 2) {501} PROGRAMMING Tutorial 1700
2652 Happy Line constructive algorithms greedy sortings Statement G Looksery Cup 2015 {549} PROGRAMMING Looksery Cup 2015 Editorial 2200
4152 Points on Plane constructive algorithms divide and conquer geometry greedy sortings Statement C Codeforces Round 319 (Div. 1) {576} PROGRAMMING Editorial Codeforces Round #319 2300
3855 Money Transfers constructive algorithms data structures greedy sortings Statement C Codeforces Round 353 (Div. 2) {675} PROGRAMMING Tutorial 2000
2386 Subordinates constructive algorithms data structures graphs greedy sortings Statement E Technocup 2017 - Elimination Round 2 {729} PROGRAMMING Technocup 2017 — Elimination Round 2 (and Codeforces Round 380) Editorial 2000
4196 Dasha and Very Difficult Problem binary search brute force constructive algorithms greedy sortings Statement D Codeforces Round 394 (Div. 2) {761} PROGRAMMING Codeforces Round #394 (Div. 2) [Editorial] 1700
38252 Mahmoud and a Triangle constructive algorithms geometry greedy math number theory sortings Statement B Codeforces Round 396 (Div. 2) {766} PROGRAMMING Codeforces round #396 editorial 1100
12749 Dishonest Sellers constructive algorithms greedy sortings Statement C Codeforces Round 402 (Div. 2) {779} PROGRAMMING Codeforces Round #402, Editorial 1200
6968 Tea Party constructive algorithms greedy sortings Statement C Educational Codeforces Round 21 {808} PROGRAMMING 52010 1500
11034 An abandoned sentiment from past constructive algorithms greedy implementation sortings Statement A Codeforces Round 418 (Div. 2) {814} PROGRAMMING Codeforces Round #418 (Div. 2) Editorial 1000
3458 Train Hard, Win Easy constructive algorithms greedy math sortings Statement E Codeforces Round 519 by Botan Investments {1043} PROGRAMMING Codeforces Round #519 Editorial 1900
6713 Decorate Apple Tree constructive algorithms dfs and similar dp graphs greedy sortings trees Statement D Mail.Ru Cup 2018 Round 3 {1056} PROGRAMMING Mail.Ru Cup 2018 Round 3 Editorial 1600
17672 Letters Rearranging constructive algorithms greedy sortings strings Statement B Educational Codeforces Round 56 (Rated for Div. 2) {1093} PROGRAMMING 63877 900
9389 Yet Another Array Partitioning Task constructive algorithms greedy sortings Statement B Codeforces Round 538 (Div. 2) {1114} PROGRAMMING Codeforces Round #538 (Div. 2) Editorial 1500
1819 Earth Wind and Fire constructive algorithms greedy math sortings two pointers Statement E Codeforces Global Round 3 {1148} PROGRAMMING Codeforces Global Round 3 Editorial 2300
8308 The Party and Sweets binary search constructive algorithms greedy implementation math sortings two pointers Statement A Codeforces Round 559 (Div. 1) {1158} PROGRAMMING 66993 1500
2114 Permutation recovery constructive algorithms data structures dfs and similar graphs greedy math sortings Statement C Codeforces Round 559 (Div. 1) {1158} PROGRAMMING 66993 2300
19186 Ehab Fails to Be Thanos constructive algorithms greedy sortings Statement A Codeforces Round 563 (Div. 2) {1174} PROGRAMMING Codeforces round #563 editorial 1000
4045 Matching vs Independent Set constructive algorithms graphs greedy sortings Statement C Codeforces Round 576 (Div. 1) {1198} PROGRAMMING E 2200
4532 Balanced Removals (Harder) binary search constructive algorithms divide and conquer greedy implementation sortings Statement C2 Codeforces Global Round 5 {1237} PROGRAMMING T 1900
6385 Minimizing Difference binary search constructive algorithms greedy sortings ternary search two pointers Statement E Codeforces Round 592 (Div. 2) {1244} PROGRAMMING Codeforces Round #592 (Div. 2) Tutorial 2000
10229 Harmonious Graph constructive algorithms dfs and similar dsu graphs greedy sortings Statement D Codeforces Round 600 (Div. 2) {1253} PROGRAMMING Editorial 1700
8192 String Coloring (easy version) constructive algorithms dp graphs greedy sortings Statement E1 Codeforces Round 617 (Div. 3) {1296} PROGRAMMING Codeforces Round #617 (Div. 3) Editorial 1800
3086 Berland Beauty constructive algorithms dfs and similar greedy sortings trees Statement F Codeforces Round 617 (Div. 3) {1296} PROGRAMMING Codeforces Round #617 (Div. 3) Editorial 2400
14639 Kuroni and the Gifts brute force constructive algorithms greedy sortings Statement A Ozon Tech Challenge 2020 (Div.1 + Div.2, Rated, T-shirts + prizes!) {1305} PROGRAMMING 500.0 Ozon Tech Challenge 2020 Editorial 800
1802 Drazil Likes Heap constructive algorithms data structures greedy implementation sortings Statement C Codeforces Round 631 (Div. 1) - Thanks, Denis aramis Shitov! {1329} PROGRAMMING 1500.0 Codeforces Round #631 Editorial 2400
4128 Challenges in school №41 brute force constructive algorithms games graphs greedy implementation sortings Statement D Codeforces Round 632 (Div. 2) {1333} PROGRAMMING 1750.0 Codeforces Round #632 (Div. 2) editorial
6362 Multiple Testcases binary search constructive algorithms data structures greedy sortings two pointers Statement D Educational Codeforces Round 86 (Rated for Div. 2) {1342} PROGRAMMING 76633 1900
1474 Summoning Minions constructive algorithms dp flows graph matchings greedy sortings Statement F Educational Codeforces Round 87 (Rated for Div. 2) {1354} PROGRAMMING 77593 2500
36653 Similar Pairs constructive algorithms graph matchings greedy sortings Statement C Codeforces Round 644 (Div. 3) {1360} PROGRAMMING Codeforces Round #644 (Div. 3) Editorial 1100
8757 Johnny and Contribution constructive algorithms graphs greedy sortings Statement A Codeforces Round 647 (Div. 1) - Thanks, Algo Muse! {1361} PROGRAMMING 500.0 Codeforces Round #647 Editorial 1700
8768 Task On The Board constructive algorithms greedy implementation sortings Statement D Codeforces Round 650 (Div. 3) {1367} PROGRAMMING Codeforces Round #650 (Div. 3) Editorial
2450 DeadLee constructive algorithms data structures graphs greedy implementation sortings Statement E Codeforces Round 652 (Div. 2) {1369} PROGRAMMING 2500.0 Codeforces Round #652 (Div. 2) Editorial 2400
3368 Inversion SwapSort constructive algorithms greedy sortings Statement E Codeforces Global Round 9 {1375} PROGRAMMING 2000.0 79731
1708 Mastermind constructive algorithms greedy implementation sortings Statement C Codeforces Round 658 (Div. 1) {1381} PROGRAMMING 2000.0 Codeforces Round #658 Editorial 2500
759 Rearrange brute force constructive algorithms graphs greedy sortings Statement D Codeforces Round 659 (Div. 1) {1383} PROGRAMMING 1750.0 Codeforces Round #659 Editorial
11042 Pinkie Pie Eats Patty-cakes binary search constructive algorithms data structures greedy math sortings Statement C Codeforces Round 662 (Div. 2) {1393} PROGRAMMING 1500.0 Codeforces Round #662 Editorial
10501 Maximum Distributed Tree constructive algorithms dfs and similar greedy math number theory sortings trees Statement D Codeforces Round 665 (Div. 2) {1401} PROGRAMMING 1750.0 Codeforces Round #665 (Div. 2) Editorial
17367 Sage's Birthday (hard version) binary search constructive algorithms greedy implementation sortings two pointers Statement D2 Codeforces Round 671 (Div. 2) {1419} PROGRAMMING 1000.0 Codeforces Round #671 Editorial
28847 Valerii Against Everyone constructive algorithms greedy sortings Statement B Codeforces Round 682 (Div. 2) {1438} PROGRAMMING 750.0 Codeforces Round #682 (Div. 2) Editorial
17642 Knapsack constructive algorithms greedy sortings Statement A Codeforces Round 683 (Div. 1, by Meet IT) {1446} PROGRAMMING 500.0 E
14107 Array Destruction constructive algorithms data structures greedy implementation sortings Statement C Codeforces Round 696 (Div. 2) {1474} PROGRAMMING 1500.0 Codeforces Round #696 Editorial
2581 Nezzar and Nice Beatmap constructive algorithms geometry greedy sortings Statement C Codeforces Round 698 (Div. 1) {1477} PROGRAMMING 1500.0 87294 2200
910 Matrix Sorting bitmasks constructive algorithms dfs and similar greedy hashing string suffix structures two pointers Statement C Codeforces Round 707 (Div. 1, based on Moscow Open Olympiad in Informatics) {1500} PROGRAMMING 1500.0 Codeforces Round #707 Editorial 2600
1255 Flip the Cards 2-sat constructive algorithms data structures dsu greedy sortings Statement D Codeforces Round 712 (Div. 1) {1503} PROGRAMMING 1750.0 T 2600
3692 Triangular Paths constructive algorithms greedy math shortest paths sortings Statement F Codeforces Round 710 (Div. 3) {1506} PROGRAMMING Editorial
13821 Morning Jogging constructive algorithms greedy sortings Statement B Contest 2050 and Codeforces Round 718 (Div. 1 + Div. 2) {1517} PROGRAMMING 1250.0 Contest 2050 and Codeforces Round #718 (Div.1 + Div.2) Editorial
14957 Great Graphs constructive algorithms graphs greedy shortest paths sortings Statement A Codeforces Round 728 (Div. 1) {1540} PROGRAMMING 500.0 Tutorial
2122 Colors and Intervals constructive algorithms data structures greedy sortings Statement E Codeforces Global Round 15 {1552} PROGRAMMING 1500.0 Editorial of Global Round 15
997 Max Sum Array combinatorics constructive algorithms greedy sortings Statement G Educational Codeforces Round 117 (Rated for Div. 2) {1612} PROGRAMMING 97164
10188 MEX and Increments constructive algorithms data structures dp greedy math sortings Statement E Codeforces Round 762 (Div. 3) {1619} PROGRAMMING Tutorial
2720 Cars constructive algorithms dfs and similar dsu graphs greedy sortings Statement E Codeforces Round 772 (Div. 2) {1635} PROGRAMMING 2250.0 Codeforces Round #772 Editorial
22654 Quality vs Quantity brute force constructive algorithms greedy sortings two pointers Statement B Codeforces Round 774 (Div. 2) {1646} PROGRAMMING 1000.0 Codeforces Round #774 (Div. 2) Editorial 800
14493 Alice and the Cake constructive algorithms data structures greedy sortings Statement C Codeforces Round 778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round) {1654} PROGRAMMING 1250.0 Editorial of Codeforces Round #778 (Div. 1 + Div. 2, based on Technocup 2022 Final Round) 1400
32622 Array Cloning Technique constructive algorithms greedy sortings Statement B Codeforces Round 781 (Div. 2) {1665} PROGRAMMING 750.0 Codeforces Round #781 (Div. 2) Editorial
745 Unordered Swaps constructive algorithms dfs and similar graphs greedy math sortings Statement E Codeforces Round 793 (Div. 2) {1682} PROGRAMMING 2500.0 Codeforces Round #793 (Div. 2) Editorial
10740 Traps constructive algorithms greedy sortings Statement D Codeforces Round 792 (Div. 1 + Div. 2) {1684} PROGRAMMING 1500.0 Codeforces Round #792 (Div. 1 + Div. 2) Editorial 1700
18573 Circular Local MiniMax constructive algorithms greedy sortings Statement A Codeforces Round 794 (Div. 1) {1685} PROGRAMMING 500.0 103198 1100
4131 Railway System constructive algorithms dsu graphs greedy interactive sortings Statement B Codeforces Round 796 (Div. 1) {1687} PROGRAMMING 750.0 Editorial of Codeforces Round 796
18996 Patchouli's Magical Talisman bitmasks constructive algorithms greedy sortings Statement B Codeforces Round 796 (Div. 2) {1688} PROGRAMMING 750.0 Tutorial
1782 PermutationForces II binary search brute force combinatorics constructive algorithms greedy sortings Statement E Codeforces Round 803 (Div. 2) {1698} PROGRAMMING 2000.0 Codeforces Round #803 (Div. 2) Editorial
1373 Connectivity Addicts constructive algorithms dsu graphs greedy interactive shortest paths sortings trees Statement F Codeforces Global Round 22 {1738} PROGRAMMING 2750.0 Editorial of Codeforces Global Round <strong>22</strong>
12302 Bricks and Bags constructive algorithms games greedy sortings Statement C Codeforces Round 831 (Div. 1 + Div. 2) {1740} PROGRAMMING 1500.0 Tutorial 1400
20603 Save the Magazines constructive algorithms greedy sortings string suffix structures Statement C Educational Codeforces Round 137 (Rated for Div. 2) {1743} PROGRAMMING Educational Codeforces Round 137 Editorial 1100
15681 Elemental Decompress constructive algorithms greedy implementation sortings Statement C Codeforces Round 842 (Div. 2) {1768} PROGRAMMING 1500.0 Codeforces Round #842 (Div. 2) Editorial
2025 Anya's Simultaneous Exhibition constructive algorithms data structures graphs greedy interactive sortings Statement E Hello 2023 {1779} PROGRAMMING 2250.0
5535 Survey in Class constructive algorithms data structures greedy implementation sortings Statement D Codeforces Round 879 (Div. 2) {1834} PROGRAMMING 1750.0 Codeforces Round #879 Editorial
21439 Rudolf and the Another Competition constructive algorithms greedy implementation sortings Statement C Codeforces Round 883 (Div. 3) {1846} PROGRAMMING
5445 Imbalanced Arrays constructive algorithms greedy sortings two pointers Statement B Codeforces Round 887 (Div. 1) {1852} PROGRAMMING 750.0 Codeforces Round 887 (Div 1, Div 2) Tutorial
43578 Olya and Game with Arrays constructive algorithms greedy math sortings Statement B Codeforces Round 892 (Div. 2) {1859} PROGRAMMING 1000.0 Video solutions from Geothermal.
20201 Smilo and Monsters constructive algorithms greedy sortings two pointers Statement C Codeforces Round 907 (Div. 2) {1891} PROGRAMMING 1000.0
11409 Neutral Tonality constructive algorithms greedy sortings two pointers Statement B Codeforces Round 908 (Div. 1) {1893} PROGRAMMING 1000.0 Codeforces Round 908 (Div. 1, Div, 2) Editorial
11571 Matching Arrays binary search constructive algorithms greedy sortings Statement C CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) {1896} PROGRAMMING 1500.0 CodeTON Round 7 (Div. 1 + Div. 2, Rated, Prizes!) Editorial
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
13137 Heavy Intervals constructive algorithms data structures dsu greedy math sortings Statement C Pinely Round 3 (Div. 1 + Div. 2) {1909} PROGRAMMING 1500.0 Editorial of Pinely Round 3 (Div. 1 + Div. 2)
26939 Minimize Inversions constructive algorithms data structures greedy implementation sortings Statement B Codeforces Round 922 (Div. 2) {1918} PROGRAMMING 1000.0 Codeforces Round #922 (Div. 2) Editorial
34870 Sasha and the Beautiful Array constructive algorithms greedy sortings Statement A Codeforces Round 926 (Div. 2) {1929} PROGRAMMING 500.0 Codeforces Round #926 (Div. 2) Editorial.
8134 Lexicographically Largest constructive algorithms data structures greedy sortings Statement C think-cell Round 1 {1930} PROGRAMMING 1500.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
9828 Cat, Fox and Double Maximum constructive algorithms greedy implementation math sortings Statement C Codeforces Round 945 (Div. 2) {1973} PROGRAMMING 1500.0 Editorial for Codeforces Round #945 (Div. 2) 1700
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
49058 Only Pluses brute force constructive algorithms greedy math sortings Statement A Codeforces Round 957 (Div. 3) {1992} PROGRAMMING Shayan's Video Tutorial
16527 Concatenation of Arrays constructive algorithms greedy math sortings Statement A Codeforces Round 980 (Div. 1) {2023} PROGRAMMING 500.0 135341
6579 Darius' Wisdom constructive algorithms greedy implementation sortings Statement D Rayan Programming Contest 2024 - Selection (Codeforces Round 989, Div. 1 + Div. 2) {2034} PROGRAMMING 1500.0 Rayan 2024 Selection Round Editorial
12478 Customer Service brute force constructive algorithms graph matchings greedy math sortings Statement C Codeforces Round 1002 (Div. 2) {2059} PROGRAMMING 1500.0 139094
29089 Milya and Two Arrays constructive algorithms greedy sortings Statement A Codeforces Round 1002 (Div. 2) {2059} PROGRAMMING 500.0 139094
1893 A, B, AB and BA constructive algorithms greedy sortings strings Statement E Educational Codeforces Round 174 (Rated for Div. 2) {2069} PROGRAMMING 139774
14426 Breach of Faith constructive algorithms greedy math sortings Statement A Codeforces Round 1008 (Div. 1) {2077} PROGRAMMING 500.0 Codeforces Round 1008 (Div. 1, Div. 2) Editorial
1170 MST in Modulo Graph constructive algorithms dsu graphs greedy math number theory sortings Statement D Codeforces Round 1010 (Div. 1, Unrated) {2081} PROGRAMMING 1750.0 Codeforces Round 1010 (Div. 1, Div. 2, based on Zhili Cup 2025) Editorial
11909 Creating a Schedule constructive algorithms data structures greedy sortings Statement D Educational Codeforces Round 179 (Rated for Div. 2) {2111} PROGRAMMING Educational Codeforces Round 179 Editorial
1412 Grid Coloring constructive algorithms greedy sortings Statement E Codeforces Round 1030 (Div. 2) {2118} PROGRAMMING 2500.0 Codeforces Round 1030 (Div. 2) Editorial
12482 Divine Tree constructive algorithms greedy math sortings trees Statement C Codeforces Round 1033 (Div. 2) and CodeNite 2025 {2120} PROGRAMMING 1250.0 Codeforces Round 1033 (Div. 2) and CodeNite 2025 Editorial
8325 Manhattan Pairs constructive algorithms greedy math sortings Statement C Order Capital Round 1 (Codeforces Round 1038, Div. 1 + Div. 2) {2122} PROGRAMMING 1500.0 Order Capital Round 1 (Codeforces Round 1038, Div. 1 + Div. 2) Editorial
21312 Deque Process constructive algorithms greedy sortings two pointers Statement B Codeforces Round 1039 (Div. 2) {2128} PROGRAMMING 1000.0 Codeforces Round #1039 — Editorial
12409 Loyalty constructive algorithms greedy sortings two pointers Statement C Pinely Round 5 (Div. 1 + Div. 2) {2161} PROGRAMMING 1750.0
35775 Isamatdin and His Magic Wand! constructive algorithms greedy implementation sortings Statement C Codeforces Round 1062 (Div. 4) {2167} PROGRAMMING Arpa Video Tutorial
137 Elevator Against Humanity brute force constructive algorithms greedy sortings Statement E 2025-2026 ICPC, NERC, Northern Eurasia Finals (Unrated, Online Mirror, ICPC Rules, Teams Preferred) {2181} PROGRAMMING Tutorial
15677 Restricted Sorting binary search constructive algorithms greedy sortings Statement A Codeforces Round 1077 (Div. 1) {2187} PROGRAMMING 750.0 Codeforces Round 1077 (Div. 1, Div. 2) Editorial