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
2222 3-cycles constructive algorithms graphs greedy Statement E Codeforces Beta Round 40 (Div. 2) {41} PROGRAMMING Codeforces Beta Round #40 Mini-Tutorial 1900
297 Grocer's Problem constructive algorithms graphs greedy Statement D Codeforces Beta Round 75 (Div. 1 Only) {91} PROGRAMMING Analysis Codeforces Beta Round #75 2500
572 Swaps constructive algorithms graphs greedy Statement C Codeforces Testing Round 3 {134} PROGRAMMING 2200
288 Deputies constructive algorithms graphs greedy implementation Statement D Croc Champ 2012 - Round 1 {173} PROGRAMMING Croc Champ 2012 — Round 1 — Editorial 2400
874 Trails and Glades constructive algorithms dsu graphs greedy Statement C VK Cup 2012 Finals, Practice Session {209} PROGRAMMING 2400
2824 Cycles binary search constructive algorithms graphs greedy Statement A Codeforces Round 144 (Div. 1) {232} PROGRAMMING Editorial for Codeforces Round #144 1800
1662 Black and White Tree constructive algorithms dsu graphs greedy trees Statement D Codeforces Round 158 (Div. 2) {260} PROGRAMMING Codeforces Round #158 (Div. 2) Tutorial 2200
1812 Flawed Flow constructive algorithms flows graphs greedy Statement C Codeforces Round 165 (Div. 1) {269} PROGRAMMING Разбор Codeforces Round #165 2500
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
1995 Arthur and Walls constructive algorithms data structures graphs greedy shortest paths Statement D Codeforces Round 297 (Div. 2) {525} PROGRAMMING Codeforces Round #297 (Div.2) Editorial 2300
1580 Looksery Party constructive algorithms dfs and similar graphs greedy Statement B Looksery Cup 2015 {549} PROGRAMMING Looksery Cup 2015 Editorial 2300
718 CNF 2 constructive algorithms dfs and similar graphs greedy Statement C Codeforces Round 317 [AimFund Thanks-Round] (Div. 1) {571} PROGRAMMING Codeforces Round #317 [AimFund Thanks-Round] Editorial 2600
2248 One-Way Reform constructive algorithms dfs and similar flows graphs greedy Statement E Codeforces Round 375 (Div. 2) {723} PROGRAMMING Codeforces Round #375 (Div.2) Editorial 2300
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
2367 Dasha and Puzzle constructive algorithms dfs and similar graphs greedy trees Statement E Codeforces Round 394 (Div. 2) {761} PROGRAMMING Codeforces Round #394 (Div. 2) [Editorial] 2000
461 Tournament Construction constructive algorithms dp graphs greedy math Statement D Codeforces Round 432 (Div. 1, based on IndiaHacks Final Round 2017) {850} PROGRAMMING Codeforces Round #432 editorial 2700
421 Berland Army constructive algorithms graphs greedy Statement B 2017-2018 ACM-ICPC, NEERC, Southern Subregional Contest (Online Mirror, ACM-ICPC Rules, Teams Preferred) {883} PROGRAMMING 2800
2261 Tree Destruction constructive algorithms dfs and similar graphs greedy trees Statement F Educational Codeforces Round 35 (Rated for Div. 2) {911} PROGRAMMING T 2500
6625 Relatively Prime Graph brute force constructive algorithms graphs greedy math Statement D Educational Codeforces Round 47 (Rated for Div. 2) {1009} PROGRAMMING 60630 1700
3850 Tree Reconstruction constructive algorithms data structures graphs greedy Statement E Codeforces Round 509 (Div. 2) {1041} PROGRAMMING Codeforces Round #509 (Div. 2) 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
1161 Construct a tree binary search constructive algorithms dfs and similar graphs greedy trees Statement C Codeforces Round 530 (Div. 1) {1098} PROGRAMMING 64331 2300
3797 Spanning Tree with One Fixed Degree constructive algorithms dfs and similar dsu graphs greedy Statement F2 Codeforces Round 544 (Div. 3) {1133} PROGRAMMING Codeforces Round #544 (Div. 3) Editorial 2200
2542 Privatization of Roads in Treeland binary search constructive algorithms dfs and similar graphs greedy trees Statement G Codeforces Round 547 (Div. 3) {1141} PROGRAMMING 66062 2500
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
4045 Matching vs Independent Set constructive algorithms graphs greedy sortings Statement C Codeforces Round 576 (Div. 1) {1198} PROGRAMMING E 2200
10229 Harmonious Graph constructive algorithms dfs and similar dsu graphs greedy sortings Statement D Codeforces Round 600 (Div. 2) {1253} PROGRAMMING Editorial 1700
3868 Decreasing Debts constructive algorithms data structures graphs greedy implementation math two pointers Statement D Codeforces Global Round 6 {1266} PROGRAMMING Codeforces Global Round 6 Editorial 2000
5454 Numbers on Tree constructive algorithms data structures dfs and similar graphs greedy trees Statement B Codeforces Round 612 (Div. 1) {1286} PROGRAMMING Codeforces Round #612 - Editorial 2000
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
6678 Shortest and Longest LIS constructive algorithms graphs greedy two pointers Statement D Codeforces Round 620 (Div. 2) {1304} PROGRAMMING 1750.0 Codeforces Round #620 (Div. 2) Editorial 1800
2319 Ehab's Last Theorem constructive algorithms dfs and similar graphs greedy Statement F Codeforces Round 628 (Div. 2) {1325} PROGRAMMING 2750.0 74235 2600
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
7718 Minimum Euler Cycle constructive algorithms graphs greedy implementation Statement D Educational Codeforces Round 85 (Rated for Div. 2) {1334} PROGRAMMING Educational Codeforces Round 85 Editorial
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
20687 Solve The Maze constructive algorithms dfs and similar dsu graphs greedy implementation shortest paths Statement D Codeforces Round 648 (Div. 2) {1365} PROGRAMMING 1500.0 Editorial — Codeforces Round #648 1700
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
759 Rearrange brute force constructive algorithms graphs greedy sortings Statement D Codeforces Round 659 (Div. 1) {1383} PROGRAMMING 1750.0 Codeforces Round #659 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
5390 Binary Table (Hard Version) constructive algorithms graphs greedy implementation Statement A2 Codeforces Round 684 (Div. 1) {1439} PROGRAMMING 500.0 Codeforces Round #684[Div1 and Div2] Editorial
12287 Longest Simple Cycle constructive algorithms dp graphs greedy Statement C Educational Codeforces Round 103 (Rated for Div. 2) {1476} PROGRAMMING 87356
4847 AB Graph constructive algorithms graphs greedy implementation strings Statement D Codeforces Round 699 (Div. 2) {1481} PROGRAMMING 2000.0 Codeforces Round #699 (Div. 2) Editorial
15386 Minimum Ties brute force constructive algorithms dfs and similar graphs greedy implementation math Statement C Educational Codeforces Round 104 (Rated for Div. 2) {1487} PROGRAMMING 87873
12429 Min Cost String brute force constructive algorithms dfs and similar graphs greedy Statement D Educational Codeforces Round 107 (Rated for Div. 2) {1511} PROGRAMMING 89634
2068 Phoenix and Earthquake constructive algorithms dfs and similar dsu graphs greedy trees Statement F Codeforces Global Round 14 {1515} PROGRAMMING 3250.0 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
14957 Great Graphs constructive algorithms graphs greedy shortest paths sortings Statement A Codeforces Round 728 (Div. 1) {1540} PROGRAMMING 500.0 Tutorial
442 The Final Pursuit constructive algorithms graphs greedy Statement E Codeforces Round 730 (Div. 2) {1543} PROGRAMMING 3000.0 Codeforces Round #730 (Div. 2) Editorial
15973 Mocha and Diana (Easy Version) brute force constructive algorithms dsu graphs greedy trees Statement D1 Codeforces Round 738 (Div. 2) {1559} PROGRAMMING 1500.0 Tutorial (en) 1400
3048 Mocha and Diana (Hard Version) brute force constructive algorithms dfs and similar dsu graphs greedy trees two pointers Statement D2 Codeforces Round 738 (Div. 2) {1559} PROGRAMMING 1500.0 Tutorial (en) 2500
383 Four Vertices constructive algorithms data structures graphs greedy implementation shortest paths Statement G Codeforces Global Round 16 {1566} PROGRAMMING 3000.0 Codeforces Global Round 16 Editorial
12450 Diameter of Graph constructive algorithms graphs greedy math Statement B Codeforces Round 745 (Div. 2) {1581} PROGRAMMING 1000.0 Codeforces Round #745 Editorial 1200
2479 Moment of Bloom constructive algorithms dfs and similar graph matchings graphs greedy Statement E Technocup 2022 - Elimination Round 1 {1583} PROGRAMMING 2250.0 Editorial for Technocup 2022 — Elimination Round 1 and Codeforces Round #749 (Div. 1+Div. 2)
3243 Treelabeling bitmasks constructive algorithms dfs and similar games graphs greedy trees Statement D Codeforces Round 754 (Div. 2) {1605} PROGRAMMING 2000.0 tutorial 2100
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
3526 Array Shuffling constructive algorithms graphs greedy Statement F1 Codeforces Global Round 20 {1672} PROGRAMMING 1250.0 Global Round 20 Editorial 2000
4073 Tokitsukaze and Two Colorful Tapes constructive algorithms dfs and similar dsu graphs greedy Statement C Codeforces Round 789 (Div. 1) {1677} PROGRAMMING 1250.0 Tutorial
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
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
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>
10240 SlavicG's Favorite Problem bitmasks brute force constructive algorithms data structures dfs and similar graphs greedy Statement G Codeforces Round 835 (Div. 4) {1760} PROGRAMMING 109348
10709 Set Construction constructive algorithms dfs and similar graphs greedy Statement C Pinely Round 1 (Div. 1 + Div. 2) {1761} PROGRAMMING 1250.0 Pinely Round 1 (Div. 1 + Div. 2) Editorial
2142 Make It Connected constructive algorithms graphs greedy Statement E Pinely Round 1 (Div. 1 + Div. 2) {1761} PROGRAMMING 1750.0 Pinely Round 1 (Div. 1 + Div. 2) Editorial
11188 Playoff combinatorics constructive algorithms dp graphs greedy Statement D Educational Codeforces Round 140 (Rated for Div. 2) {1767} PROGRAMMING 110225
4151 Train Splitting constructive algorithms graphs greedy Statement F SWERC 2022-2023 - Online Mirror (Unrated, ICPC Rules, Teams Preferred) {1776} PROGRAMMING
2025 Anya's Simultaneous Exhibition constructive algorithms data structures graphs greedy interactive sortings Statement E Hello 2023 {1779} PROGRAMMING 2250.0
15223 Unforgivable Curse (hard version) brute force constructive algorithms constructive algorithms dsu graphs greedy Statement E2 Codeforces Round 855 (Div. 3) {1800} PROGRAMMING Codeforces Round 855 (Div. 3) Editorial
15542 Unforgivable Curse (easy version) brute force constructive algorithms dsu graphs greedy Statement E1 Codeforces Round 855 (Div. 3) {1800} PROGRAMMING Codeforces Round 855 (Div. 3) Editorial
2349 Between constructive algorithms dfs and similar graphs greedy shortest paths Statement C Codeforces Round 865 (Div. 1) {1815} PROGRAMMING 1750.0 Editorial of Codeforces Round #865 2200
4715 Tenzing and His Animal Friends brute force constructive algorithms graphs greedy shortest paths Statement D CodeTON Round 5 (Div. 1 + Div. 2, Rated, Prizes!) {1842} PROGRAMMING 1500.0 CodeTON Round 5 Editorial
6863 Cyclic Operations constructive algorithms dfs and similar graphs greedy implementation Statement D Codeforces Round 897 (Div. 2) {1867} PROGRAMMING 2000.0
2739 Candy Party (Hard Version) bitmasks constructive algorithms dp graphs greedy implementation math Statement B2 Codeforces Round 896 (Div. 1) {1868} PROGRAMMING 750.0 Codeforces Round 896 (Div. 1, Div. 2) Editorial
8299 Candy Party (Easy Version) bitmasks constructive algorithms graphs greedy implementation math Statement B1 Codeforces Round 896 (Div. 1) {1868} PROGRAMMING 500.0 Codeforces Round 896 (Div. 1, Div. 2) Editorial
2323 Lights constructive algorithms dfs and similar graphs greedy implementation Statement G Codeforces Round 913 (Div. 3) {1907} PROGRAMMING Codeforces Round 913 (Div. 3) Editorial
3508 Clique Partition constructive algorithms graphs greedy Statement E Educational Codeforces Round 163 (Rated for Div. 2) {1948} PROGRAMMING Educational Codeforces Round 163 Editorial
103 Growing Trees constructive algorithms flows graphs greedy Statement I Codeforces Global Round 25 {1951} PROGRAMMING 4000.0 Codeforces Global Round 25 Editorial
7869 Prime XOR Coloring bitmasks constructive algorithms graphs greedy math number theory Statement D Pinely Round 4 (Div. 1 + Div. 2) {1991} PROGRAMMING 1500.0 Video Tutorial
5101 Coloring Game constructive algorithms games graphs greedy interactive Statement E Pinely Round 4 (Div. 1 + Div. 2) {1991} PROGRAMMING 2000.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
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
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
3478 Kevin and Bipartite Graph constructive algorithms graphs greedy Statement E Codeforces Global Round 28 {2048} PROGRAMMING 1750.0 Tutorial
18221 Vicious Labyrinth constructive algorithms graphs greedy implementation math Statement B Codeforces Round 1008 (Div. 2) {2078} PROGRAMMING 750.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
1492 Gleb and Boating brute force constructive algorithms data structures dp graphs greedy math shortest paths Statement G Codeforces Round 1013 (Div. 3) {2091} PROGRAMMING Codeforces Round 1013 (Div. 3) 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
877 Sea, You & copriMe brute force combinatorics constructive algorithms graphs greedy math number theory Statement H Codeforces Round 1042 (Div. 3) {2131} PROGRAMMING Codeforces Round 1042 (Div. 3) Editorial
13965 Cyclic Merging brute force constructive algorithms graphs greedy trees Statement A Codeforces Round 1064 (Div. 1) {2165} PROGRAMMING 500.0 148452
6653 Xmas or Hysteria constructive algorithms graphs greedy implementation Statement D Good Bye 2025 {2178} PROGRAMMING 1750.0
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
4041 Tree Orientation (Easy Version) constructive algorithms dfs and similar dsu graphs greedy trees Statement D1 Codeforces Round 1086 (Div. 2) {2208} PROGRAMMING 1250.0 Tutorial