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
1850 Average Score greedy math sortings Statement C Yandex.Algorithm Open 2011: Qualification 1 {81} PROGRAMMING 1700
5729 Division into Teams greedy math sortings Statement C Codeforces Round 106 (Div. 2) {149} PROGRAMMING Codeforces Round #106 (Div. 2) Tutorial 1500
7415 Median greedy math sortings Statement C Codeforces Round 113 (Div. 2) {166} PROGRAMMING Codeforces Round #113 (Div. 2) Tutorial 1500
2430 Two Heaps combinatorics constructive algorithms greedy implementation math sortings Statement B Codeforces Round 205 (Div. 2) {353} PROGRAMMING 9145 1800
9584 New Year Permutation dfs and similar dsu graphs greedy math sortings Statement B Good Bye 2014 {500} PROGRAMMING Tutorial 2 1600
28656 Drazil and Factorial greedy math sortings Statement C Codeforces Round 292 (Div. 2) {515} PROGRAMMING Codeforces Round #292 Editorial 1400
6058 Ilya and Sticks greedy math sortings Statement C Codeforces Round 297 (Div. 2) {525} PROGRAMMING Codeforces Round #297 (Div.2) Editorial 1600
4209 Arthur and Table brute force data structures dp greedy math sortings Statement C Codeforces Round 311 (Div. 2) {557} PROGRAMMING Codeforces Round #311 (Div.2) Editorial 1900
614 Bear and Paradox greedy math sortings Statement E VK Cup 2016 - Round 1 {639} PROGRAMMING Tutorial 2800
2264 Ray Tracing greedy hashing implementation math number theory sortings Statement C Intel Code Challenge Final Round (Div. 1 + Div. 2, Combined) {724} PROGRAMMING Tutorial 1800
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
7445 Leha and Function combinatorics greedy math number theory sortings Statement A Codeforces Round 429 (Div. 1) {840} PROGRAMMING Editorial 1300
9955 Swap Adjacent Elements dfs and similar greedy math sortings two pointers Statement C Educational Codeforces Round 37 (Rated for Div. 2) {920} PROGRAMMING T 1500
2049 Leaving the Bar brute force data structures geometry greedy math sortings Statement C Codeforces Round 492 (Div. 1) [Thanks, uDebug!] {995} PROGRAMMING Editorial for Codeforces Round #492 [Thanks u-Debug!] 2200
8238 Maximal Intersection greedy math sortings Statement C Codeforces Round 506 (Div. 3) {1029} PROGRAMMING Codeforces Round #506 (Div. 3) Editorial 1600
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
1086 New Year and the Acquaintance Estimation binary search data structures graphs greedy implementation math sortings Statement E Good Bye 2018 {1091} PROGRAMMING Editorial 2400
15738 Lunar New Year and Number Division greedy implementation math sortings Statement C Codeforces Round 536 (Div. 2) {1106} PROGRAMMING Tutorial 1000
15715 Emotes greedy math sortings Statement B Educational Codeforces Round 60 (Rated for Div. 2) {1117} PROGRAMMING 65365 1000
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
9053 Stas and the Queue at the Buffet greedy math sortings Statement D Codeforces Round 553 (Div. 2) {1151} PROGRAMMING Codeforces Round #553 (Div. 2) Editorial 1500
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
9894 Two Arrays and Sum of Functions greedy math sortings Statement E Codeforces Round 560 (Div. 3) {1165} PROGRAMMING Codeforces Round #560 (Div. 3) Editorial 1800
15285 Number Circle greedy math sortings Statement B Codeforces Round 572 (Div. 2) {1189} PROGRAMMING Editorial of Codeforces Round #572 1100
14027 DIY Wooden Ladder greedy math sortings Statement A Educational Codeforces Round 69 (Rated for Div. 2) {1197} PROGRAMMING E 1000
32761 Maximum Median binary search greedy math sortings Statement C Codeforces Round 577 (Div. 2) {1201} PROGRAMMING Codeforces Round #577 (Div 2) Editorial 1400
17992 Grow The Tree greedy math sortings Statement B Codeforces Round 594 (Div. 2) {1248} PROGRAMMING Editorial of Codeforces Round #594 (on the problems of Moscow Team Olympiad) 900
15284 Sweets Eating dp greedy math sortings Statement C Codeforces Round 600 (Div. 2) {1253} PROGRAMMING Editorial 1500
22043 Three Friends brute force greedy math sortings Statement A Codeforces Round 605 (Div. 3) {1272} PROGRAMMING Codeforces Round #605 (Div. 3) Editorial 900
4566 Kate and imperfection greedy implementation math number theory sortings two pointers Statement F Codeforces Round 632 (Div. 2) {1333} PROGRAMMING 2500.0 Codeforces Round #632 (Div. 2) editorial
12116 Xenia and Colorful Gems binary search greedy math sortings two pointers Statement B Codeforces Round 635 (Div. 1) {1336} PROGRAMMING 750.0 Codeforces Round #635 Editorial 1800
5824 Restorer Distance binary search greedy math sortings ternary search Statement E Codeforces Round 643 (Div. 2) {1355} PROGRAMMING 2000.0 Codeforces Round #643 (Div. 2) Editorial 2100
3843 Johnny and Grandmaster greedy implementation math sortings Statement B Codeforces Round 647 (Div. 1) - Thanks, Algo Muse! {1361} PROGRAMMING 1250.0 Codeforces Round #647 Editorial 1900
20839 RationalLee greedy math sortings Statement C Codeforces Round 652 (Div. 2) {1369} PROGRAMMING 1500.0 Codeforces Round #652 (Div. 2) Editorial 1400
6072 Choosing flowers binary search data structures greedy math sortings two pointers Statement C Codeforces Round 657 (Div. 2) {1379} PROGRAMMING 1250.0 Codeforces Round #657 Editorial 2000
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
2592 Two Types of Spells binary search data structures greedy implementation math sortings Statement E Educational Codeforces Round 93 (Rated for Div. 2) {1398} PROGRAMMING Educational Codeforces Round 93 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
15062 Two Arrays greedy math sortings Statement B Codeforces Round 673 (Div. 2) {1417} PROGRAMMING 1000.0 Codeforces Round #673 Editorial 1100
16547 Saving the City greedy math sortings Statement B Codeforces Round 681 (Div. 2, based on VK Cup 2019-2020 - Final) {1443} PROGRAMMING 1000.0 VK Cup 2019-2020 -- Engine Editorial
15460 Toy Blocks binary search greedy math sortings Statement B Educational Codeforces Round 98 (Rated for Div. 2) {1452} PROGRAMMING 84847
18297 Equalize the Array binary search data structures greedy math sortings Statement F Codeforces Round 702 (Div. 3) {1490} PROGRAMMING Codeforces Round #702 (Div. 3) Editorial
17867 Diamond Miner geometry greedy math sortings Statement A Codeforces Round 706 (Div. 1) {1495} PROGRAMMING 500.0 Codeforces Round #706 Editorial
3692 Triangular Paths constructive algorithms greedy math shortest paths sortings Statement F Codeforces Round 710 (Div. 3) {1506} PROGRAMMING Editorial
34131 Array Reodering brute force greedy math number theory sortings Statement B Educational Codeforces Round 110 (Rated for Div. 2) {1535} PROGRAMMING 91481
17686 Two Arrays greedy math sortings Statement C Technocup 2022 - Elimination Round 2 {1584} PROGRAMMING 1000.0 Editorial for Technocup 2022 — Elimination Round 2 and Codeforces Round #755 (Div. 1, Div. 2) 900
23741 Gamer Hemose greedy math sortings Statement A Codeforces Round 746 (Div. 2) {1592} PROGRAMMING 500.0 95583
18108 Blue-Red Permutation greedy math sortings Statement D Codeforces Round 753 (Div. 3) {1607} PROGRAMMING Codeforces Round #753 (Div. 3) Editorial
2805 Messages greedy math probabilities sortings Statement E Educational Codeforces Round 117 (Rated for Div. 2) {1612} PROGRAMMING 97164
1922 Trader Problem binary search data structures dsu greedy math sortings Statement G Codeforces Round 760 (Div. 3) {1618} PROGRAMMING Codeforces Round #760 (Div. 3) Editorial
10188 MEX and Increments constructive algorithms data structures dp greedy math sortings Statement E Codeforces Round 762 (Div. 3) {1619} PROGRAMMING Tutorial
4457 Rescheduling the Exam binary search data structures greedy implementation math sortings Statement E Codeforces Round 776 (Div. 3) {1650} PROGRAMMING 100712
17911 Social Distance greedy math sortings Statement B Codeforces Round 783 (Div. 2) {1668} PROGRAMMING 500.0 Codeforces Round #783 Editorial 900
60313 Equal Candies greedy math sortings Statement B Codeforces Round 790 (Div. 4) {1676} PROGRAMMING Codeforces Round #790 (Div. 4) 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
6260 Permutation Restoration binary search data structures greedy math sortings Statement D Educational Codeforces Round 131 (Rated for Div. 2) {1701} PROGRAMMING Educational Codeforces Round 131 Editorial
7663 Maximum AND bitmasks brute force divide and conquer greedy math sortings Statement D Educational Codeforces Round 134 (Rated for Div. 2) {1721} PROGRAMMING 106416
2025 Red-Black Pepper binary search brute force greedy math number theory sortings ternary search Statement E Educational Codeforces Round 135 (Rated for Div. 2) {1728} PROGRAMMING 106805
17912 Minimum Notation data structures greedy math sortings Statement C Codeforces Round 823 (Div. 2) {1730} PROGRAMMING 1500.0 Codeforces Round #823 — editorial 1200
22396 Select Three Sticks greedy math sortings Statement A Codeforces Round 822 (Div. 2) {1734} PROGRAMMING 500.0 Codeforces Round #822 (Div.2) Editorial
24475 Divisibility by 2^n greedy math sortings Statement D Codeforces Round 828 (Div. 3) {1744} PROGRAMMING Codeforces Round #828 (Div. 3) Editorial
1599 Gaining Rating binary search greedy math sortings Statement G Codeforces Round 839 (Div. 3) {1772} PROGRAMMING 110313
463 GCD Master (easy version) greedy math number theory sortings Statement F1 Codeforces Round 858 (Div. 2) {1806} PROGRAMMING 2500.0 Codeforces Round #858 (Div. 2) Editorial
465 GCD Master (hard version) greedy math sortings Statement F2 Codeforces Round 858 (Div. 2) {1806} PROGRAMMING 1500.0 Codeforces Round #858 (Div. 2) Editorial
27659 Subsequence Addition (Hard Version) dp greedy implementation math sortings Statement G2 Codeforces Round 859 (Div. 4) {1807} PROGRAMMING 114143
12447 Search in Parallel greedy math sortings Statement C Educational Codeforces Round 146 (Rated for Div. 2) {1814} PROGRAMMING Educational Codeforces Round 146 Editorial
2696 Rearrange Brackets dp greedy math sortings Statement E Educational Codeforces Round 147 (Rated for Div. 2) {1821} PROGRAMMING 115296
1071 Lottery binary search brute force greedy math sortings two pointers Statement B Codeforces Round 880 (Div. 1) {1835} PROGRAMMING 1250.0 Codeforces Round 880 Editorial
1026 The Boss's Identity binary search bitmasks data structures dfs and similar greedy math sortings Statement F Codeforces Round 882 (Div. 2) {1847} PROGRAMMING 3000.0 Tutorial
24201 Vika and the Bridge binary search data structures greedy implementation math sortings Statement B Codeforces Round 885 (Div. 2) {1848} PROGRAMMING 1000.0 Codeforces Round #885 (Div.2) Editorial
7373 Lisa and the Martians bitmasks data structures greedy math sortings strings trees Statement F Codeforces Round 888 (Div. 3) {1851} PROGRAMMING 118667
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.
16796 Split Sort greedy math sortings Statement B Pinely Round 2 (Div. 1 + Div. 2) {1863} PROGRAMMING 750.0
1079 Brukhovich and Exams brute force greedy math sortings Statement E Codeforces Round 907 (Div. 2) {1891} PROGRAMMING 2000.0
21557 Points and Minimum Distance greedy math sortings Statement B Educational Codeforces Round 157 (Rated for Div. 2) {1895} PROGRAMMING Educational Codeforces Round 157 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)
25527 Anna and the Valentine's Day Gift games greedy math sortings Statement E Codeforces Round 925 (Div. 3) {1931} PROGRAMMING 125878
42022 Turtle Puzzle: Rearrange and Negate greedy math sortings Statement A Codeforces Round 929 (Div. 3) {1933} PROGRAMMING Codeforces Round 929 (Div. 3) Editorial
13737 Ticket Hoarding greedy math sortings Statement C Codeforces Global Round 25 {1951} PROGRAMMING 1500.0 Codeforces Global Round 25 Editorial
8005 Colored Balls combinatorics dp greedy math sortings Statement D Educational Codeforces Round 164 (Rated for Div. 2) {1954} PROGRAMMING Educational Codeforces Round 164 Editorial
16651 Everything Nim games greedy math sortings Statement A Codeforces Round 941 (Div. 1) {1965} PROGRAMMING 500.0 Codeforces Round #941 (Div. 1, Div. 2) Editorial 1400
14908 Permutation Counting binary search greedy implementation math sortings Statement A Codeforces Round 942 (Div. 1) {1967} PROGRAMMING 750.0 Tutorial 1400
5687 Shop Game data structures greedy math sortings Statement D Educational Codeforces Round 165 (Rated for Div. 2) {1969} PROGRAMMING Educational Codeforces Round 165 Editorial 1900
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
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
8011 Nikita and LCM brute force data structures dp greedy math number theory sortings Statement C Codeforces Round 948 (Div. 2) {1977} PROGRAMMING 1750.0 129858 1900
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
7082 Smithing Skill brute force dp greedy math sortings two pointers Statement D Educational Codeforces Round 167 (Rated for Div. 2) {1989} PROGRAMMING Educational Codeforces Round 167 Editorial
2770 Triangle Formation brute force greedy math sortings Statement F Pinely Round 4 (Div. 1 + Div. 2) {1991} PROGRAMMING 2500.0 Video Tutorial
49058 Only Pluses brute force constructive algorithms greedy math sortings Statement A Codeforces Round 957 (Div. 3) {1992} PROGRAMMING Shayan's Video Tutorial
37864 Angry Monk greedy math sortings Statement B Codeforces Round 957 (Div. 3) {1992} PROGRAMMING Shayan's Video Tutorial
10131 Bouquet (Hard Version) binary search data structures greedy math sortings two pointers Statement B2 Codeforces Round 961 (Div. 2) {1995} PROGRAMMING 500.0 Video Tutorial
21564 The Strict Teacher (Hard Version) binary search greedy math sortings Statement B2 Codeforces Round 972 (Div. 2) {2005} PROGRAMMING 500.0 Discussion stream (With Hints)
24670 The Strict Teacher (Easy Version) greedy math sortings Statement B1 Codeforces Round 972 (Div. 2) {2005} PROGRAMMING 500.0 Discussion stream (With Hints)
237 Complex Segments (Easy Version) binary search data structures divide and conquer dsu greedy math sortings Statement E1 Codeforces Round 975 (Div. 1) {2018} PROGRAMMING 2250.0 Editorial of Codeforces Round 975 (Div. 1, Div. 2)
203 Complex Segments (Hard Version) binary search data structures divide and conquer dsu greedy math sortings Statement E2 Codeforces Round 975 (Div. 1) {2018} PROGRAMMING 750.0 Editorial of Codeforces Round 975 (Div. 1, Div. 2)
21483 Meaning Mean data structures greedy math sortings Statement A Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) {2021} PROGRAMMING 500.0 Codeforces Round #977 (Div. 2, based on COMPFEST 16 — Final Round) Editorial
16527 Concatenation of Arrays constructive algorithms greedy math sortings Statement A Codeforces Round 980 (Div. 1) {2023} PROGRAMMING 500.0 135341
7662 Refined Product Optimality binary search data structures greedy implementation math schedules sortings Statement D Good Bye 2024: 2025 is NEAR {2053} PROGRAMMING 1750.0 Good Bye 2024: 2025 is NEAR 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
610 Traveling Salescat dp geometry greedy math sortings Statement F Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2) {2062} PROGRAMMING 3500.0 Ethflow Round 1 (Codeforces Round 1001, Div. 1 + Div. 2) Editorial
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
28254 Kamilka and the Sheep greedy implementation math sortings Statement A Codeforces Round 1014 (Div. 2) {2092} PROGRAMMING 500.0 Codeforces Round #1014 (Div. 2) Editorial
16491 Wonderful Gloves greedy math sortings Statement B Neowise Labs Contest 1 (Codeforces Round 1018, Div. 1 + Div. 2) {2096} PROGRAMMING 750.0 Neowise Labs Contest 1 (Codeforces Round 1018, Div. 1 + Div. 2) Editorial
25501 Cherry Bomb greedy math sortings Statement C Codeforces Round 1020 (Div. 3) {2106} PROGRAMMING Codeforces Round 1020 (Div. 3) 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
4861 A Cruel Segment's Thesis greedy math sortings Statement D Codeforces Round 1049 (Div. 2) {2140} PROGRAMMING 1750.0 Codeforces Round 1049 (Div. 2) Editorial
5935 Billion Players Game greedy math sortings ternary search two pointers Statement D Codeforces Round 1066 (Div. 1 + Div. 2) {2157} PROGRAMMING 1500.0 Codeforces Round 1066 (Div. 1 + Div. 2) Editorial
15581 Odd Process greedy math sortings Statement C Codeforces Round 1070 (Div. 2) {2176} PROGRAMMING 1500.0 Codeforces Round 1070 (Div.2) Editorial