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
10050 Routine Problem greedy math number theory Statement B Codeforces Round 196 (Div. 2) {337} PROGRAMMING Codeforces Round #196 — Problems Analysis 1400
5222 Quiz binary search greedy math matrices number theory Statement C Codeforces Round 196 (Div. 2) {337} PROGRAMMING Codeforces Round #196 — Problems Analysis 1700
2782 Upgrading Array dp greedy math number theory Statement D Codeforces Round 236 (Div. 2) {402} PROGRAMMING Editorial Codeforces Round #236 2000
20690 A and B and Team Training greedy implementation math number theory Statement C Codeforces Round 294 (Div. 2) {519} PROGRAMMING Editorial 1300
5861 Vanya and Scales brute force dp greedy math meet-in-the-middle number theory Statement C Codeforces Round 308 (Div. 2) {552} PROGRAMMING Codeforces #308 (Div. 2) Editorial 1800
4613 Block Towers brute force greedy math number theory Statement C 8VC Venture Cup 2016 - Elimination Round {626} PROGRAMMING 23522 1600
10251 Co-prime Array greedy implementation math number theory Statement A Educational Codeforces Round 11 {660} PROGRAMMING Editorial of Educational Codeforces Round 11 1300
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
56864 Bachgold Problem greedy implementation math number theory Statement A Codeforces Round 388 (Div. 2) {749} PROGRAMMING Tutorial 700
11403 Bash's Big Day greedy math number theory Statement B Codecraft-17 and Codeforces Round 391 (Div. 1 + Div. 2, combined) {757} PROGRAMMING CodeCraft-17 and Codeforces Round #391 (Div. 1 + Div. 2, combined) Editorial 1400
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
4982 Divide by Three dp greedy math number theory Statement C Educational Codeforces Round 18 {792} PROGRAMMING Educational Codeforces Round 18 - Editorial 2000
1263 Colored Balls greedy math number theory Statement E Educational Codeforces Round 18 {792} PROGRAMMING Educational Codeforces Round 18 - Editorial 2400
3282 My pretty girl Noora brute force dp greedy math number theory Statement D Codeforces Round 422 (Div. 2) {822} PROGRAMMING Codeforces Round #422 (Div. 2) Editorial 1800
7445 Leha and Function combinatorics greedy math number theory sortings Statement A Codeforces Round 429 (Div. 1) {840} PROGRAMMING Editorial 1300
9758 Maximum splitting dp greedy math number theory Statement C Technocup 2018 - Elimination Round 2 {870} PROGRAMMING Editorial Codeforces Round 440 Div.1+Div.2 (and Technocup 2018 — Elimination Round 2) 1300
14178 Pride brute force dp greedy math number theory Statement A Codeforces Round 446 (Div. 1) {891} PROGRAMMING Codeforces Round #446 Editorial 1600
3262 Mahmoud and Ehab and another array construction task constructive algorithms greedy math number theory Statement D Codeforces Round 473 (Div. 2) {959} PROGRAMMING Codeforces round #473 editorial 2000
2171 Kuro and GCD and XOR and SUM binary search bitmasks brute force data structures dp dsu greedy math number theory strings trees Statement D Codeforces Round 482 (Div. 2) {979} PROGRAMMING 1750.0 Codeforces Round #482 (Div. 2) Editorial 2200
18779 Relatively Prime Pairs greedy math number theory Statement B Educational Codeforces Round 51 (Rated for Div. 2) {1051} PROGRAMMING Educational Codeforces Round 51 Editorial 1000
9823 Math greedy math number theory Statement B Codeforces Round 520 (Div. 2) {1062} PROGRAMMING Tutorial 1600
2814 Missing Numbers binary search constructive algorithms greedy math number theory Statement E Avito Cool Challenge 2018 {1081} PROGRAMMING 63888 1900
25136 Divisors of Two Integers brute force greedy math number theory Statement B Codeforces Round 535 (Div. 3) {1108} PROGRAMMING 64751 1100
17778 Prefix Sum Primes constructive algorithms greedy math number theory Statement A Codeforces Round 556 (Div. 1) {1149} PROGRAMMING 66783 1300
3247 Minimum Possible LCM brute force greedy math number theory Statement G Codeforces Round 552 (Div. 3) {1154} PROGRAMMING Codeforces Round #552 (Div. 3) Editorial 2400
7903 Prime Graph constructive algorithms greedy math number theory Statement D Codeforces Global Round 4 {1178} PROGRAMMING E 1600
926 Polygons greedy math number theory Statement G Manthan, Codefest 19 (open for everyone, rated, Div. 1 + Div. 2) {1208} PROGRAMMING 69357 2700
5004 Send Boxes to Alice (Easy Version) constructive algorithms greedy math number theory ternary search two pointers Statement B1 Codeforces Round 601 (Div. 1) {1254} PROGRAMMING Codeforces Round #601 Editorial 2000
3416 Send Boxes to Alice (Hard Version) constructive algorithms greedy math number theory ternary search two pointers Statement B2 Codeforces Round 601 (Div. 1) {1254} PROGRAMMING Codeforces Round #601 Editorial 2100
730 Divisor Set divide and conquer fft greedy math number theory Statement G Educational Codeforces Round 76 (Rated for Div. 2) {1257} PROGRAMMING Educational Codeforces Round 76 Editorial 2700
8773 Infinite Fence greedy math number theory Statement C Educational Codeforces Round 77 (Rated for Div. 2) {1260} PROGRAMMING Educational Codeforces Round 77 Editorial 1700
10053 Diverse Matrix constructive algorithms greedy math number theory Statement C Codeforces Global Round 6 {1266} PROGRAMMING Codeforces Global Round 6 Editorial 1400
966 Chaotic V. dp graphs greedy math number theory trees Statement D Codeforces Round 614 (Div. 1) {1292} PROGRAMMING 1750.0 Codeforces Round #614 Editorial 2700
45976 Product of Three Numbers greedy math number theory Statement C Codeforces Round 615 (Div. 3) {1294} PROGRAMMING Codeforces Round #615 (Div. 3) Editorial 1300
18314 Adding Powers bitmasks greedy implementation math number theory ternary search Statement C Educational Codeforces Round 83 (Rated for Div. 2) {1312} PROGRAMMING 74640
18917 Composite Coloring brute force constructive algorithms greedy math number theory Statement B Codeforces Round 630 (Div. 2) {1332} PROGRAMMING 1000.0 Codeforces Round #630 Editorial 1500
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
3167 Divisor Paths combinatorics graphs greedy math number theory Statement E Educational Codeforces Round 85 (Rated for Div. 2) {1334} PROGRAMMING Educational Codeforces Round 85 Editorial
8332 A/B Matrix constructive algorithms flows greedy math number theory Statement G Codeforces Round 644 (Div. 3) {1360} PROGRAMMING Codeforces Round #644 (Div. 3) Editorial 1900
36174 Omkar and Last Class of Math constructive algorithms greedy math number theory Statement B Codeforces Round 655 (Div. 2) {1372} PROGRAMMING 1000.0 Codeforces Round #655 Editorial 1300
2946 Sum of Digits brute force constructive algorithms dp greedy math number theory Statement E Educational Codeforces Round 90 (Rated for Div. 2) {1373} PROGRAMMING Educational Codeforces Round 90 Editorial
49634 LCM Problem constructive algorithms greedy math number theory Statement A Educational Codeforces Round 92 (Rated for Div. 2) {1389} PROGRAMMING 80809
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
18051 Big Vova brute force greedy math number theory Statement B Codeforces Round 669 (Div. 2) {1407} PROGRAMMING 1000.0 Codeforces Round #669 Editorial
18092 Add to Neighbour and Remove greedy math number theory Statement D Codeforces Round 690 (Div. 3) {1462} PROGRAMMING Codeforces Round #690 (Div. 3) Editorial
371 Prime Divisors Selection greedy math number theory Statement L 2020-2021 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules) {1468} PROGRAMMING Tutorial (PDF)
37940 Strange Partition greedy math number theory Statement A Codeforces Round 694 (Div. 2) {1471} PROGRAMMING 500.0 Codeforces Round #694 Editorial
40032 Different Divisors binary search constructive algorithms greedy math number theory Statement B Codeforces Round 696 (Div. 2) {1474} PROGRAMMING 1000.0 Codeforces Round #696 Editorial
9092 Square-free division (easy version) data structures dp greedy math number theory Statement E1 Codeforces Round 708 (Div. 2) {1497} PROGRAMMING 1500.0 Codeforces Round #708 Editorial 1700
1910 Square-free division (hard version) data structures dp greedy hashing math number theory Statement E2 Codeforces Round 708 (Div. 2) {1497} PROGRAMMING 1500.0 Codeforces Round #708 Editorial 2500
34131 Array Reodering brute force greedy math number theory sortings Statement B Educational Codeforces Round 110 (Rated for Div. 2) {1535} PROGRAMMING 91481
40633 Exciting Bets greedy math number theory Statement A Codeforces Round 730 (Div. 2) {1543} PROGRAMMING 500.0 Codeforces Round #730 (Div. 2) Editorial
5337 Array Stabilization (AND version) binary search brute force graphs greedy implementation math number theory shortest paths Statement F Codeforces Round 744 (Div. 3) {1579} PROGRAMMING Codeforces Round #744 (Div. 3) Editorial
2259 Extreme Extension dp greedy math number theory Statement C Codeforces Round 752 (Div. 1) {1603} PROGRAMMING 1750.0 Editorial of Codeforces Round #752 2300
18862 Divide and Multiply greedy implementation math number theory Statement A Deltix Round, Autumn 2021 (open for everyone, rated, Div. 1 + Div. 2) {1609} PROGRAMMING 500.0 Deltix Round, Autumn 2021. Editorial 900
25230 GCD Arrays greedy math number theory Statement B Codeforces Round 767 (Div. 2) {1629} PROGRAMMING 750.0 Editorial of Codeforces Round #767
5313 New Year Concert binary search data structures dp greedy math number theory two pointers Statement D Codeforces Round 769 (Div. 2) {1632} PROGRAMMING 2000.0 Editorial of Codeforces Round #769
39744 AvtoBus brute force greedy math number theory Statement A Codeforces Round 791 (Div. 2) {1679} PROGRAMMING 500.0 Codeforces Round #791 (Div. 2) Editorial
9433 Equate Multisets constructive algorithms data structures graph matchings greedy math number theory Statement F Codeforces Round 805 (Div. 3) {1702} PROGRAMMING 104763
3449 Fibonacci Strings brute force data structures greedy implementation math number theory Statement B Codeforces Round 814 (Div. 1) {1718} PROGRAMMING 1250.0 Codeforces Round #814 (Div. 1, Div. 2) Editorial
1851 Tonya and Burenka-179 brute force data structures greedy math number theory Statement C Codeforces Round 814 (Div. 1) {1718} PROGRAMMING 1250.0 Codeforces Round #814 (Div. 1, Div. 2) Editorial
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
3465 Graph Cost dp greedy math number theory Statement E Codeforces Round 841 (Div. 2) and Divide by Zero 2022 {1731} PROGRAMMING 2000.0 Codeforces Round #841 (Div. 2) and Divide By Zero 2022 Editorial
4493 All Possible Digits binary search data structures greedy math number theory Statement F Codeforces Round 834 (Div. 3) {1759} PROGRAMMING 109254
20558 Divide and Conquer greedy math number theory Statement A Codeforces Round 838 (Div. 2) {1762} PROGRAMMING 500.0 Codeforces Round #838 (Div. 2) Editorial
10500 Lucky Chains brute force dp greedy math number theory Statement D Educational Codeforces Round 139 (Rated for Div. 2) {1766} PROGRAMMING 110066
31021 Greatest Convex greedy math number theory Statement A Codeforces Round 842 (Div. 2) {1768} PROGRAMMING 500.0 Codeforces Round #842 (Div. 2) Editorial
25785 GCD Partition brute force greedy math number theory Statement B Codeforces Round 846 (Div. 2) {1780} PROGRAMMING 1000.0 111841
14869 Number Factorization greedy math number theory Statement B TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) {1787} PROGRAMMING 1000.0 TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) Editorial
9357 Candy Store greedy math number theory Statement C Codeforces Round 860 (Div. 2) {1798} PROGRAMMING 1250.0 Editorial of Codeforces Round 860 (Div. 2) 1700
13808 Pull Your Luck brute force greedy math number theory Statement C Nebius Welcome Round (Div. 1 + Div. 2) {1804} PROGRAMMING 1000.0 Nebius Welcome Round Editorial
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
13816 Strongly Composite greedy math number theory Statement C Codeforces Round 868 (Div. 2) {1823} PROGRAMMING 1250.0 115465
15643 Dreaming of Freedom greedy math number theory Statement C Codeforces Round 870 (Div. 2) {1826} PROGRAMMING 1500.0 Codeforces Round #870 (Div. 2) Editorial 1300
7147 Vika and Price Tags greedy math number theory Statement C Codeforces Round 885 (Div. 2) {1848} PROGRAMMING 1500.0 Codeforces Round #885 (Div.2) Editorial
44554 Longest Divisors Interval brute force combinatorics greedy math number theory Statement B Codeforces Round 889 (Div. 2) {1855} PROGRAMMING 1000.0 Editorial of Codeforces Round 889 (Div. 1 + Div. 2)
12999 The Walkway brute force greedy implementation math number theory Statement B Codeforces Round 893 (Div. 2) {1858} PROGRAMMING 1250.0 Codeforces Round #893 (Div. 2) Editorial 1500
13852 Jellyfish and Green Apple bitmasks greedy math number theory Statement C Codeforces Round 901 (Div. 2) {1875} PROGRAMMING 1000.0 Codeforces Round 901 (Div. 1, Div. 2) Editorial
16915 Insert and Equalize brute force constructive algorithms greedy math number theory Statement C Educational Codeforces Round 159 (Rated for Div. 2) {1902} PROGRAMMING Educational Codeforces Round 159 Editorial
5108 Split Plus K greedy math number theory Statement D Pinely Round 3 (Div. 1 + Div. 2) {1909} PROGRAMMING 2000.0 Editorial of Pinely Round 3 (Div. 1 + Div. 2)
23069 A Balanced Problemset? brute force greedy math number theory Statement B Codeforces Round 921 (Div. 2) {1925} PROGRAMMING 1000.0 Codeforces Round 921 (Div. 1, Div. 2) Editorial
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
2955 Chain Reaction data structures dsu greedy implementation math number theory Statement E Educational Codeforces Round 164 (Rated for Div. 2) {1954} PROGRAMMING Educational Codeforces Round 164 Editorial
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
17321 GCD-sequence greedy implementation math math number theory number theory Statement D Codeforces Round 950 (Div. 3) {1980} PROGRAMMING 130135
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
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
10254 Squaring brute force constructive algorithms data structures greedy implementation math number theory Statement C Codeforces Round 961 (Div. 2) {1995} PROGRAMMING 1750.0 Video Tutorial
6645 Sakurako's Task binary search brute force greedy math number theory Statement G Codeforces Round 970 (Div. 3) {2008} PROGRAMMING Codeforces Round 970 (Div. 3) Editorial
3580 Sakurako's Test binary search brute force greedy math number theory Statement H Codeforces Round 970 (Div. 3) {2008} PROGRAMMING Codeforces Round 970 (Div. 3) Editorial
4199 Prefix GCD brute force dp greedy math number theory Statement E Codeforces Round 973 (Div. 2) {2013} PROGRAMMING 2500.0 134298
18751 Maximize Mex brute force greedy math number theory Statement B Codeforces Round 977 (Div. 2, based on COMPFEST 16 - Final Round) {2021} PROGRAMMING 750.0 Codeforces Round #977 (Div. 2, based on COMPFEST 16 — Final Round) Editorial
3520 Common Generator brute force constructive algorithms greedy math number theory Statement E Refact.ai Match 1 (Codeforces Round 985) {2029} PROGRAMMING 2500.0 Refact.ai Match 1 (Codeforces Round 985) Editorial
24642 Circuit greedy implementation math number theory Statement A Codeforces Round 983 (Div. 2) {2032} PROGRAMMING 500.0 Codeforces Round 983 (Div. 2) Editorial
20513 Everyone Loves Tres constructive algorithms greedy math number theory Statement B Codeforces Global Round 27 {2035} PROGRAMMING 500.0 Codeforces Global Round 27 Editorial
25464 Superultra's Favorite Permutation constructive algorithms greedy math number theory Statement C Codeforces Round 988 (Div. 3) {2037} PROGRAMMING Video Tutorial
1770 Grid Walk dp greedy math number theory Statement K 2024-2025 ICPC, NERC, Southern and Volga Russian Regional Contest (Unrated, Online Mirror, ICPC Rules, Preferably Teams) {2038} PROGRAMMING 2100
6941 Shohag Loves GCD constructive algorithms greedy math number theory Statement D CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!) {2039} PROGRAMMING 2000.0 Editorial of CodeTON Round 9 (Div. 1 + Div. 2)
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
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
13108 Array and GCD binary search greedy math number theory Statement D Educational Codeforces Round 178 (Rated for Div. 2) {2104} PROGRAMMING Educational Codeforces Round 178 Editorial
22088 Permutation Warm-Up combinatorics greedy math number theory Statement A Codeforces Round 1022 (Div. 2) {2108} PROGRAMMING 500.0 Codeforces Round 1022 Editorial
14807 Gellyfish and Flaming Peony brute force constructive algorithms dp greedy math number theory shortest paths Statement A Codeforces Round 1028 (Div. 1) {2115} PROGRAMMING 500.0 Codeforces Round 1028 (Div.1, Div.2) Editorial
27197 Left and Down greedy math number theory Statement B Educational Codeforces Round 181 (Rated for Div. 2) {2125} PROGRAMMING Educational Codeforces Round 181 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
13422 No Cost Too Great (Easy Version) greedy implementation math number theory Statement C1 Codeforces Round 1060 (Div. 2) {2154} PROGRAMMING 1250.0 Codeforces Round 1060 (Div. 2) Editorial
5467 No Cost Too Great (Hard Version) greedy math number theory Statement C2 Codeforces Round 1060 (Div. 2) {2154} PROGRAMMING 1000.0 Codeforces Round 1060 (Div. 2) Editorial
12177 Maximum GCD on Whiteboard greedy math number theory Statement C Codeforces Round 1061 (Div. 2) {2156} PROGRAMMING 1500.0 Codeforces Round 1061 (Div. 2) Editorial
2251 Removal of a Sequence (Hard Version) binary search constructive algorithms divide and conquer greedy implementation math number theory probabilities Statement D2 Educational Codeforces Round 184 (Rated for Div. 2) {2169} PROGRAMMING Educational Codeforces Round 184 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
7686 Divisive Battle games greedy math number theory Statement E Codeforces Round 1084 (Div. 3) {2200} PROGRAMMING Codeforces Round 1084 (Div. 3) Editorial
16795 The 67th OEIS Problem greedy math number theory Statement D Codeforces Round 1090 (Div. 4) {2218} PROGRAMMING