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
5265 Two Paths dfs and similar dp graphs shortest paths trees two pointers Statement D Codeforces Beta Round 14 (Div. 2) {14} PROGRAMMING Codeforces Beta Round #14 tutorial 2100
811 Caterpillar dfs and similar dp graphs trees Statement F Codeforces Beta Round 48 {51} PROGRAMMING 2600
398 Pairs dfs and similar dp dsu graphs implementation trees Statement E Yandex.Algorithm Open 2011: Qualification 1 {81} PROGRAMMING 2600
1051 Beautiful Road dfs and similar dp dsu graphs implementation sortings trees Statement D Codeforces Beta Round 73 (Div. 1 Only) {87} PROGRAMMING CodeForces Beta Round #73 div. 1 analysis (particulary with div. 2) 2300
12413 Choosing Capital for Treeland dfs and similar dp graphs trees Statement D Codeforces Round 135 (Div. 2) {219} PROGRAMMING User editorial for Codeforces Round #135 (Div. 2) 1900
2310 Cactus data structures dfs and similar dp graphs trees Statement E Codeforces Round 143 (Div. 2) {231} PROGRAMMING Tutorial Codeforces Round #143 2400
3926 Cow Program dfs and similar dp graphs Statement B Codeforces Round 174 (Div. 1) {283} PROGRAMMING Editorial for Codeforces #174 1900
8750 Xenia and Weights constructive algorithms dfs and similar dp graphs greedy shortest paths Statement C Codeforces Round 197 (Div. 2) {339} PROGRAMMING Codeforces Round #197 — Tutorial 1700
1283 Valera and Fools dfs and similar dp graphs shortest paths Statement D Codeforces Round 216 (Div. 2) {369} PROGRAMMING Editorial Codeforces Round #216 (Div. 2) 2300
3005 Inna and Dima dfs and similar dp graphs implementation Statement C Codeforces Round 220 (Div. 2) {374} PROGRAMMING Codeforces Round #220 (Div. 2) разбор 2000
7273 Gargari and Permutations dfs and similar dp graphs implementation Statement D Codeforces Round 264 (Div. 2) {463} PROGRAMMING CF 264 Div 2 Tutorial 2000
2023 Fedor and Essay dfs and similar dp graphs hashing strings Statement D Codeforces Round 267 (Div. 2) {467} PROGRAMMING 2100
14869 Mr. Kitayuta's Colorful Graph dfs and similar dp dsu graphs Statement B Codeforces Round 286 (Div. 2) {505} PROGRAMMING Tutorial 1500
3237 Breaking Good dfs and similar dp graphs shortest paths Statement E Codeforces Round 287 (Div. 2) {507} PROGRAMMING 2200
18755 Reposts *special dfs and similar dp graphs trees Statement A VK Cup 2015 - Qualification Round 1 {522} PROGRAMMING Разбор задач VK Cup 2015 — Квалификация 1 1700
2683 Work Group dfs and similar dp graphs strings trees Statement B VK Cup 2015 - Round 2 (unofficial online mirror, Div. 1 only) {533} PROGRAMMING 2000
2953 Super M dfs and similar dp graphs trees Statement D Codeforces Round 328 (Div. 2) {592} PROGRAMMING Codeforces Round #328 Problem Analysis 2200
424 Wilbur and Strings dfs and similar dp graphs strings Statement E Codeforces Round 331 (Div. 2) {596} PROGRAMMING Codeforces Round #331 Editorial 2900
4005 Kingdom and its Cities dfs and similar divide and conquer dp graphs sortings trees Statement D Codeforces Round 339 (Div. 1) {613} PROGRAMMING Tutorial 2800
979 Preorder Test binary search dfs and similar dp graphs greedy trees Statement D 8VC Venture Cup 2016 - Final Round {627} PROGRAMMING 8VC Venture Cup 2016 — Final Round Editorial 2600
1372 The Chocolate Spree dfs and similar dp graphs trees Statement F Manthan, Codefest 16 {633} PROGRAMMING Manthan, Codefest 16: Editorials 2500
2172 Table Compression dfs and similar dp dsu graphs greedy Statement C Codeforces Round 345 (Div. 1) {650} PROGRAMMING Codeforces Round #345: editorial 2300
8066 Alyona and the Tree dfs and similar dp graphs trees Statement C Codeforces Round 358 (Div. 2) {682} PROGRAMMING 45491 1700
4631 Connecting Universities dfs and similar dp graphs trees Statement B Codeforces Round 364 (Div. 1) {700} PROGRAMMING 46283 2100
4334 Centroids data structures dfs and similar dp graphs greedy trees Statement C AIM Tech Round 3 (Div. 1) {708} PROGRAMMING Editorial 2500
4706 Chloe and pleasant prizes dfs and similar dp graphs trees Statement D Codeforces Round 384 (Div. 2) {743} PROGRAMMING Codeforces Round #384 Editorial 1800
552 Broken Tree dfs and similar dp graphs greedy trees Statement E Codeforces Round 392 (Div. 2) {758} PROGRAMMING Codeforces Round #392 (Div. 2) Editorial 2900
11854 Timofey and a tree dfs and similar dp dsu graphs implementation trees Statement A Codeforces Round 395 (Div. 1) {763} PROGRAMMING Codeforces Round #395 [Editorial] 1600
3891 Mahmoud and a Dictionary data structures dfs and similar dp dsu graphs Statement D Codeforces Round 396 (Div. 2) {766} PROGRAMMING Codeforces round #396 editorial 2000
7146 Police Stations constructive algorithms dfs and similar dp graphs shortest paths trees Statement D Codeforces Round 408 (Div. 2) {796} PROGRAMMING Tutorial 2100
215 Fake bullions combinatorics dfs and similar dp graphs number theory Statement F Codeforces Round 411 (Div. 1) {804} PROGRAMMING Codeforces Round #411 Editorial 3400
1233 Roads in the Kingdom dfs and similar dp graphs trees Statement F Codeforces Round 427 (Div. 2) {835} PROGRAMMING Editorial 2400
20001 Journey dfs and similar dp graphs probabilities trees Statement C Codeforces Round 428 (Div. 2) {839} PROGRAMMING Codeforces Round #428 editorial 1500
2803 Leha and another game about graph constructive algorithms data structures dfs and similar dp graphs Statement B Codeforces Round 429 (Div. 1) {840} PROGRAMMING Editorial 2100
281 Harry Vs Voldemort dfs and similar dp graphs trees Statement G Manthan, Codefest 17 {855} PROGRAMMING 54750 3000
2446 Coprocessor dfs and similar dp graphs greedy Statement E Codeforces Round 455 (Div. 2) {909} PROGRAMMING Codeforces Round #455 (Div. 2) Editorial 2100
3984 MADMAX dfs and similar dp games graphs Statement B Codeforces Round 459 (Div. 1) {917} PROGRAMMING Codeforces Round #459 Editorial 1800
12184 Substring dfs and similar dp graphs Statement D Codeforces Round 460 (Div. 2) {919} PROGRAMMING Codeforces Round #460 (Div. 2) Editorial 1700
3407 Sleepy Game dfs and similar dp games graphs Statement B Codeforces Round 467 (Div. 1) {936} PROGRAMMING Codeforces Round #467, Editorial 2100
15741 Cut 'em all! dfs and similar dp graphs greedy trees Statement C Codeforces Round 484 (Div. 2) {982} PROGRAMMING Editorial 1500
1094 Maximum Matching bitmasks brute force dfs and similar dp graphs Statement E Codeforces Round 508 (Div. 2) {1038} PROGRAMMING Tutorial 2400
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
1091 Tree data structures dfs and similar dp graphs trees Statement E CodeCraft-19 and Codeforces Round 537 (Div. 2) {1111} PROGRAMMING CodeCraft-19 and Codeforces Round #537 (Div. 2) Editorial 2800
1767 Power Tree dfs and similar dp dsu graphs greedy trees Statement D Codeforces Round 543 (Div. 1, based on Technocup 2019 Final Round) {1120} PROGRAMMING Разбор задач финала Технокубка 2019 и Codeforces Round #543 2400
3617 Gourmet choice dfs and similar dp dsu graphs greedy Statement D Codeforces Round 541 (Div. 2) {1131} PROGRAMMING Codeforces Round #541 Editorial 2000
1162 Graph Traveler brute force data structures dfs and similar dp graphs implementation math number theory Statement F Codeforces Round 578 (Div. 2) {1200} PROGRAMMING Codeforces Round #578 (Div. 2) Editorial 2500
2999 Tourism dfs and similar dp dsu graphs greedy trees Statement E Codeforces Round 586 (Div. 1 + Div. 2) {1220} PROGRAMMING Codeforces Round #586 Editorial 2200
2051 The Maximum Subtree dfs and similar dp graphs trees Statement F Educational Codeforces Round 74 (Rated for Div. 2) {1238} PROGRAMMING Educational Codeforces Round 74 Editorial 2300
1943 Sum Balance bitmasks dfs and similar dp graphs Statement C Codeforces Round 599 (Div. 1) {1242} PROGRAMMING Codeforces Round #599 Editorial 2400
949 Economic Difficulties data structures dfs and similar dp flows graphs trees Statement F Codeforces Round 603 (Div. 2) {1263} PROGRAMMING Разбор Codeforces Round #603 (Div. 2) 2500
528 Around the World bitmasks combinatorics dfs and similar dp graphs graphs math trees Statement D Codeforces Round 618 (Div. 1) {1299} PROGRAMMING 1750.0 Codeforces Round #618 Editorial 2900
12957 Maximum White Subtree dfs and similar dp graphs trees Statement F Codeforces Round 627 (Div. 3) {1324} PROGRAMMING Codeforces Round #627 (Div. 3) Editorial
1976 Quantifier Question dfs and similar dp graphs math Statement C Codeforces Round 639 (Div. 1) {1344} PROGRAMMING 1500.0 Codeforces Round #639 Editorial 2600
3675 Graph Coloring dfs and similar dp graphs Statement E Educational Codeforces Round 87 (Rated for Div. 2) {1354} PROGRAMMING 77593 2100
4951 Ehab's Last Corollary constructive algorithms data structures dfs and similar dp graphs implementation trees Statement D Codeforces Round 649 (Div. 2) {1364} PROGRAMMING 2000.0 Codeforces round #649 editorial 2100
6902 Captain Flint and Treasure data structures dfs and similar dp graphs greedy implementation trees Statement D Codeforces Round 660 (Div. 2) {1388} PROGRAMMING 2000.0 Codeforces Round #660 Editorial 2000
492 Directing Edges dfs and similar dp graphs greedy trees Statement G Educational Codeforces Round 92 (Rated for Div. 2) {1389} PROGRAMMING 80809
233 Star Trek *special combinatorics dfs and similar dp games graphs matrices trees Statement C Central-European Olympiad in Informatics, CEOI 2020, Day 1 (IOI, Unofficial Mirror Contest, Unrated) {1402} PROGRAMMING Editorial
1885 Egor in the Republic of Dagestan constructive algorithms dfs and similar dp graphs greedy shortest paths Statement E Codeforces Round 669 (Div. 2) {1407} PROGRAMMING 2500.0 Codeforces Round #669 Editorial
5611 Moving to the Capital dfs and similar dp graphs shortest paths Statement G Codeforces Round 693 (Div. 3) {1472} PROGRAMMING Codeforces Round #693 (Div. 3) Editorial
2289 Nastia Plays with a Tree constructive algorithms data structures dfs and similar dp flows graphs greedy implementation trees Statement D Codeforces Round 720 (Div. 2) {1521} PROGRAMMING 2250.0 90477
13768 Little Alawn's Puzzle combinatorics dfs and similar dp dsu graphs math Statement C Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) {1534} PROGRAMMING 1250.0 Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) Editorial
699 Falling Sand (Hard Version) dfs and similar dp graphs greedy Statement F2 Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) {1534} PROGRAMMING 1250.0 Codeforces LATOKEN Round 1 (Div. 1 + Div. 2) Editorial
3521 How Many Paths? dfs and similar dp graphs trees Statement G Codeforces Round 731 (Div. 3) {1547} PROGRAMMING Codeforces Round #731 (Div. 3) Editorial
9105 Bakry and Partitioning bitmasks constructive algorithms dfs and similar dp graphs trees Statement C Codeforces Round 746 (Div. 2) {1592} PROGRAMMING 1500.0 95583
9321 The Number of Imposters constructive algorithms dfs and similar dp dsu graphs Statement D Codeforces Round 747 (Div. 2) {1594} PROGRAMMING 1750.0 95525 1700
7350 Game Master data structures dfs and similar dp graphs greedy two pointers Statement C Codeforces Round 758 (Div.1 + Div. 2) {1608} PROGRAMMING 1000.0 Editorial of Codeforces Round #758 (Div.1 + Div. 2)
424 Just Add an Edge dfs and similar dp graphs Statement G Good Bye 2021: 2022 is NEAR {1616} PROGRAMMING 3500.0 Good Bye 2021 -- Editorial 3500
1008 Christmas Chocolates dfs and similar dp games graphs implementation math number theory shortest paths trees Statement E Codeforces Round 761 (Div. 2) {1617} PROGRAMMING 3000.0 Editorial for Codeforces Round #761 (Div. 2)
1148 Cats on the Upgrade (easy version) data structures dfs and similar divide and conquer dp graphs trees Statement E1 Codeforces Round 765 (Div. 2) {1625} PROGRAMMING 2000.0 Editorial of Codeforces Round #765 (Div. 2)
2918 Counting Shortcuts dfs and similar dp graphs shortest paths Statement G Codeforces Round 776 (Div. 3) {1650} PROGRAMMING 100712
2891 Remove Directed Edges dfs and similar dp graphs Statement G Codeforces Round 786 (Div. 3) {1674} PROGRAMMING 102482
23784 White-Black Balanced Subtrees dfs and similar dp graphs trees Statement G Codeforces Round 790 (Div. 4) {1676} PROGRAMMING Codeforces Round #790 (Div. 4) Editorial
5806 Toss a Coin to Your Graph... binary search dfs and similar dp graphs Statement D Codeforces Round 791 (Div. 2) {1679} PROGRAMMING 1750.0 Codeforces Round #791 (Div. 2) Editorial
1449 Coloring brute force combinatorics constructive algorithms dfs and similar dp dsu graphs implementation Statement E Educational Codeforces Round 130 (Rated for Div. 2) {1697} PROGRAMMING 103835
862 Maximizing Root dfs and similar dp graphs math trees Statement F Codeforces Round 848 (Div. 2) {1778} PROGRAMMING 2750.0 Codeforces Round #848 (Div. 2) Editorial
7599 Gardening Friends brute force dfs and similar dp graphs trees Statement F Codeforces Round 867 (Div. 3) {1822} PROGRAMMING Codeforces Round #867 (Div. 3) Editorial
20182 Copil Copac Draws Trees dfs and similar dp graphs trees Statement A Codeforces Round 875 (Div. 1) {1830} PROGRAMMING 500.0 Codeforces Round #875 (Div.1 + Div. 2) Editorial
2104 Railguns dfs and similar dp graphs implementation Statement F Codeforces Round 878 (Div. 3) {1840} PROGRAMMING Codeforces Round #878 (Div.3) Editorial
13247 Nastya and Potions dfs and similar dp graphs greedy shortest paths sortings Statement E Codeforces Round 888 (Div. 3) {1851} PROGRAMMING 118667
3181 Speedrun brute force data structures dfs and similar dp graphs sortings Statement E Pinely Round 2 (Div. 1 + Div. 2) {1863} PROGRAMMING 1750.0
3420 Completely Searching for Inversions dfs and similar dp graphs Statement C COMPFEST 15 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) {1866} PROGRAMMING COMPFEST 15 Preliminary — Editorial
2712 Autosynthesis 2-sat constructive algorithms dfs and similar dp flows graphs trees Statement C Codeforces Round 902 (Div. 1, based on COMPFEST 15 - Final Round) {1876} PROGRAMMING 1250.0 Codeforces Round #902 (Div. 1, Div. 2, based on COMPFEST 15 — Final Round) Editorial
9504 Minimum Maximum Distance dfs and similar dp graphs shortest paths trees Statement F Codeforces Round 903 (Div. 3) {1881} PROGRAMMING 121327
276 Cacti Symphony combinatorics dfs and similar dp graphs Statement E Codeforces Round 908 (Div. 1) {1893} PROGRAMMING 2750.0 Codeforces Round 908 (Div. 1, Div, 2) Editorial
2626 Transitive Graph constructive algorithms dfs and similar dp graphs implementation Statement E Codeforces Round 911 (Div. 2) {1900} PROGRAMMING 2250.0 Codeforces Round 911 (Div. 2) Editorial
1972 Compressed Tree dfs and similar dp graphs greedy trees Statement E Educational Codeforces Round 158 (Rated for Div. 2) {1901} PROGRAMMING Educational Codeforces Round 158 Editorial
2385 Light Bulbs (Easy Version) brute force combinatorics dfs and similar dp dsu graphs math Statement G1 Codeforces Round 916 (Div. 3) {1914} PROGRAMMING Codeforces Round 916 (Div. 3) Editorial
1805 Light Bulbs (Hard Version) combinatorics data structures dfs and similar dp dsu graphs hashing Statement G2 Codeforces Round 916 (Div. 3) {1914} PROGRAMMING Codeforces Round 916 (Div. 3) Editorial
4506 Vlad and Trouble at MIT dfs and similar dp flows graphs greedy implementation trees Statement G Codeforces Round 928 (Div. 4) {1926} PROGRAMMING 126132
2940 Turtle Mission: Robot and the Earthquake dfs and similar dp graphs shortest paths Statement F Codeforces Round 929 (Div. 3) {1933} PROGRAMMING Codeforces Round 929 (Div. 3) Editorial
867 Min-Fund Prison (Medium) brute force dfs and similar dp graphs trees Statement G2 Helvetic Coding Contest 2024 online mirror (teams allowed, unrated) {1970} PROGRAMMING Helvetic Coding Contest 2024 Editorial 2200
538 Min-Fund Prison (Hard) bitmasks dfs and similar dp graphs trees Statement G3 Helvetic Coding Contest 2024 online mirror (teams allowed, unrated) {1970} PROGRAMMING Helvetic Coding Contest 2024 Editorial 2400
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
4627 Turtle and a MEX Problem (Hard Version) dfs and similar dp graphs greedy implementation Statement D2 Codeforces Round 968 (Div. 2) {2003} PROGRAMMING 1250.0 sol-zh.pdf
7392 Connect the Dots brute force dfs and similar dp dsu graphs math trees Statement D Codeforces Round 976 (Div. 2) and Divide By Zero 9.0 {2020} PROGRAMMING 1500.0 Tutorial for Codeforces Round 976 (Div. 2) and Divide By Zero 9.0
1047 Choose Your Queries dfs and similar dp graphs greedy trees Statement F Educational Codeforces Round 170 (Rated for Div. 2) {2025} PROGRAMMING Educational Codeforces Round 170 Editorial
3724 Alice's Adventures in Cards constructive algorithms data structures dfs and similar dp graphs greedy implementation shortest paths Statement D Codeforces Round 986 (Div. 2) {2028} PROGRAMMING 1750.0 Codeforces Round 986 (Div. 2) Editorial
3796 Medium Demon Problem (hard version) dfs and similar dp dsu graphs implementation trees Statement G2 Codeforces Round 993 (Div. 4) {2044} PROGRAMMING Codeforces Round 993 (Div. 4) Editorial
4503 Resourceful Caterpillar Sequence dfs and similar dp games graphs implementation trees Statement E Good Bye 2024: 2025 is NEAR {2053} PROGRAMMING 2000.0 Good Bye 2024: 2025 is NEAR Editorial
8529 Fewer Batteries binary search dfs and similar dp graphs greedy Statement D Codeforces Round 1026 (Div. 2) {2110} PROGRAMMING 2000.0 Codeforces Round 1026 (Div. 2) Editorial
3945 Gellyfish and Camellia Japonica constructive algorithms dfs and similar dp graphs greedy Statement B Codeforces Round 1028 (Div. 1) {2115} PROGRAMMING 1250.0 Codeforces Round 1028 (Div.1, Div.2) Editorial
2481 Red Light, Green Light (Hard version) binary search dfs and similar dp dsu graphs implementation number theory Statement D2 Codeforces Round 1030 (Div. 2) {2118} PROGRAMMING 1000.0 Codeforces Round 1030 (Div. 2) Editorial
8397 Red Light, Green Light (Easy version) brute force dfs and similar dp graphs implementation Statement D1 Codeforces Round 1030 (Div. 2) {2118} PROGRAMMING 1250.0 Codeforces Round 1030 (Div. 2) Editorial
565 23 Rises Again brute force data structures dfs and similar dp flows graphs implementation probabilities trees Statement H Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) {2127} PROGRAMMING 4000.0 Atto Round 1 (Codeforces Round 1041, Div. 1 + Div. 2) Editorial
1916 Cry Me a River dfs and similar dp games graphs Statement G Codeforces Round 1047 (Div. 3) {2137} PROGRAMMING Codeforces Round 1047 (Div. 3) Editorial
5391 Maple and Tree Beauty (Easy Version) dfs and similar dp graphs trees Statement C1 Codeforces Round 1048 (Div. 1) {2138} PROGRAMMING 1250.0 Codeforces Round 1048 (Div. 1, Div. 2) Editorial
974 Long Journey dfs and similar dp graphs matrices number theory shortest paths Statement F Educational Codeforces Round 183 (Rated for Div. 2) {2145} PROGRAMMING Educational Codeforces Round 183 Editorial
3807 Cherry Tree dfs and similar dp graphs trees Statement F Codeforces Round 1072 (Div. 3) {2184} PROGRAMMING Codeforces Round 1072 (Div. 3) Editorial
3535 Interactive Graph (Simple Version) combinatorics dfs and similar dp graphs interactive Statement C1 Codeforces Round 1079 (Div. 1) {2196} PROGRAMMING 750.0 Tutorial
2471 Interactive Graph (Hard Version) combinatorics dfs and similar dp graphs interactive Statement C2 Codeforces Round 1079 (Div. 1) {2196} PROGRAMMING 750.0 Tutorial