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
135534 Ultra-Fast Mathematician implementation Statement A Codeforces Beta Round 57 (Div. 2) {61} PROGRAMMING Round 57-A 900
1432 Lucky Permutation brute force combinatorics number theory Statement C Codeforces Beta Round 91 (Div. 1 Only) {121} PROGRAMMING Разбор задач 2000
12538 The World is a Theatre combinatorics math Statement C Codeforces Beta Round 95 (Div. 2) {131} PROGRAMMING Разбор Codeforces Beta Round #95 (Div.2) 1500
671 Periodical Numbers combinatorics dp number theory Statement E Codeforces Round 132 (Div. 2) {215} PROGRAMMING Codeforces Round #132 (Div. 2) Tutorial 2600
1750 Partial Sums combinatorics math number theory Statement C Codeforces Round 138 (Div. 1) {223} PROGRAMMING Tutorial 2200
524 Gifts combinatorics dp math probabilities Statement E Codeforces Round 142 (Div. 1) {229} PROGRAMMING Codeforces Round #142 Problem Analysis 2500
884 Number Challenge combinatorics dp implementation math number theory Statement E Codeforces Round 146 (Div. 1) {235} PROGRAMMING Codeforces Round #146 Tutorial 2600
4312 Shaass and Lights combinatorics number theory Statement C Codeforces Round 178 (Div. 2) {294} PROGRAMMING Codeforces Round #178 Editorial 1900
619 White, Black and White Again combinatorics number theory Statement C Testing Round 6 {306} PROGRAMMING 2200
1212 Vasily the Bear and Beautiful Strings combinatorics math number theory Statement D Codeforces Round 195 (Div. 2) {336} PROGRAMMING Tutorial Codeforces Round #195 (Div. 2) 2400
1626 On Number of Decompositions into Multipliers combinatorics math number theory Statement A Codeforces Round 232 (Div. 1) {396} PROGRAMMING 500.0 Codeforces Round #232 Editorial (restored)
4555 Roman and Numbers bitmasks brute force combinatorics dp number theory Statement D Codeforces Round 235 (Div. 2) {401} PROGRAMMING Codeforces Round #235 (Div. 2) — Tutorial 2000
29009 Mashmokh and ACM combinatorics dp number theory Statement B Codeforces Round 240 (Div. 1) {414} PROGRAMMING Codeforces Round #240 Editorial 1500
2126 The Child and Binary Tree combinatorics divide and conquer fft number theory Statement E Codeforces Round 250 (Div. 1) {438} PROGRAMMING Tutorial 3100
4495 Devu and Flowers bitmasks combinatorics number theory Statement E Codeforces Round 258 (Div. 2) {451} PROGRAMMING Codeforces Round #258 Editorial 2400
2083 Pluses everywhere combinatorics dp math number theory Statement E Codeforces Round 295 (Div. 2) {520} PROGRAMMING Codeforces Round #295 Editorial (now with bonuses!) 2500
3383 Mike and Foam bitmasks combinatorics dp math number theory Statement C Codeforces Round 305 (Div. 1) {547} PROGRAMMING Codeforces Round #305 Editorial 2700
2097 GukiZ and Binary Operations combinatorics implementation math matrices number theory Statement D Codeforces Round 307 (Div. 2) {551} PROGRAMMING Tutorial 2400
2373 Vitaly and Cycle combinatorics dfs and similar graphs math Statement D Codeforces Round 311 (Div. 2) {557} PROGRAMMING Codeforces Round #311 (Div.2) Editorial 2300
8026 Gerald and Giant Chess combinatorics dp math number theory Statement C Codeforces Round 313 (Div. 1) {559} PROGRAMMING Codeforces Round 313 — Extended editoral 2500
2382 Symmetric and Transitive combinatorics dp math Statement B Codeforces Round 315 (Div. 1) {568} PROGRAMMING Codeforces Round #315 Editorial 2100
1876 Bots combinatorics number theory Statement H Bubble Cup 8 - Finals [Online Mirror] {575} PROGRAMMING Bubble Cup finals 2015 Results and Editorial 1800
1220 Present for Vitalik the Philatelist combinatorics math number theory Statement E Codeforces Round 325 (Div. 1) {585} PROGRAMMING Разбор Codeforces Round #325 2800
2708 Moodular Arithmetic combinatorics dfs and similar dsu math number theory Statement B Codeforces Round 334 (Div. 1) {603} PROGRAMMING Codeforces Round #334 Editorial 2000
6218 Wet Shark and Flowers combinatorics math number theory probabilities Statement C Codeforces Round 341 (Div. 2) {621} PROGRAMMING 1700
966 Cowslip Collections combinatorics math number theory Statement F CROC 2016 - Elimination Round {645} PROGRAMMING Editorial for CROC 2016 Elimination Round 2500
642 Move by Prime combinatorics math number theory Statement G IndiaHacks 2016 - Online Edition (Div. 1 + Div. 2) {653} PROGRAMMING IndiaHacks Finals 2016 — Editorial 3000
1315 Fence Divercity combinatorics dp number theory Statement G Codeforces Round 346 (Div. 2) {659} PROGRAMMING Editorial for Codeforces Round #346 (Div. 2) 2500
487 Coprime Permutation combinatorics number theory Statement F Codeforces Round 363 (Div. 1) {698} PROGRAMMING Solution 3000
1022 PolandBall and Many Other Balls combinatorics divide and conquer dp fft math number theory Statement G 8VC Venture Cup 2017 - Elimination Round {755} PROGRAMMING 8VC Venture Cup 2017 — Elimination Round [Editorial] 3100
1543 Bash Plays with Functions brute force combinatorics dp number theory Statement E 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 2400
1121 Barrels and boxes brute force combinatorics math number theory probabilities Statement F Divide by Zero 2017 and Codeforces Round 399 (Div. 1 + Div. 2, combined) {768} PROGRAMMING Editorial Divide by Zero and Codeforces Round #399 (Div. 1+2, combined) 2300
218 Test Data Generation combinatorics divide and conquer dp fft math number theory Statement F VK Cup 2017 - Round 3 {773} PROGRAMMING VK Cup 2017 Round 3 + Codeforces Round #412 -- Tutorial 3400
3656 Anton and School - 2 combinatorics dp math number theory Statement D Codeforces Round 404 (Div. 2) {785} PROGRAMMING Editorial 2200
4600 Coprime Subsequences bitmasks combinatorics number theory Statement F Educational Codeforces Round 20 {803} PROGRAMMING 51768 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
3541 Winter is here combinatorics dp math number theory Statement D Codeforces Round 428 (Div. 2) {839} PROGRAMMING Codeforces Round #428 editorial 2200
7445 Leha and Function combinatorics greedy math number theory sortings Statement A Codeforces Round 429 (Div. 1) {840} PROGRAMMING Editorial 1300
652 Product transformation combinatorics math number theory Statement F Bubble Cup X - Finals [Online Mirror] {852} PROGRAMMING Tutorial 2300
4186 Counting Arrays combinatorics dp math number theory Statement E Educational Codeforces Round 33 (Rated for Div. 2) {893} PROGRAMMING 55989 2000
4692 Ralph And His Magic Field combinatorics constructive algorithms math number theory Statement B Codeforces Round 447 (Div. 2) {894} PROGRAMMING Codeforces Round #447 (Div.2 Only) Editorial 1800
609 Nephren Runs a Cinema chinese remainder theorem combinatorics math number theory Statement D Codeforces Round 449 (Div. 1) {896} PROGRAMMING Codeforces Round #449 Editorial 2800
3771 Unusual Sequences bitmasks combinatorics dp math number theory Statement D Codeforces Round 450 (Div. 2) {900} PROGRAMMING Codeforces Round #450(Div. 2). Editorial. 2100
1980 List Of Integers binary search bitmasks brute force combinatorics math number theory Statement G Educational Codeforces Round 37 (Rated for Div. 2) {920} PROGRAMMING T 2300
1593 Partitions combinatorics math number theory Statement G Educational Codeforces Round 41 (Rated for Div. 2) {961} PROGRAMMING Educational Codeforces Round 41 Editorial 2700
1037 Pave the Parallelepiped bitmasks brute force combinatorics math number theory Statement B Codeforces Round 497 (Div. 1) {1007} PROGRAMMING Editorial for Codeforces Round #497 by Skyglow 2400
992 Region Separation combinatorics dp number theory trees Statement C Codeforces Round 511 (Div. 1) {1034} PROGRAMMING Codeforces Round #511 Editorial 2900
1851 Relatively Prime Powers combinatorics math number theory Statement F Educational Codeforces Round 50 (Rated for Div. 2) {1036} PROGRAMMING 61727 2400
2981 Make It One bitmasks combinatorics dp math number theory shortest paths Statement F Codeforces Round 519 by Botan Investments {1043} PROGRAMMING Codeforces Round #519 Editorial 2500
1471 Alex and a TV Show bitmasks combinatorics number theory Statement F Hello 2019 {1097} PROGRAMMING 64310 2400
1499 Sasha and Interesting Fact from Graph Theory brute force combinatorics dp math trees Statement D Codeforces Round 539 (Div. 1) {1109} PROGRAMMING Codeforces Round #539 Editorial 2600
1771 Ehab and the Expected GCD Problem combinatorics dp math number theory Statement E Codeforces Round 563 (Div. 2) {1174} PROGRAMMING Codeforces round #563 editorial 2500
1207 Crossword Expert combinatorics dp number theory probabilities two pointers Statement F Educational Codeforces Round 68 (Rated for Div. 2) {1194} PROGRAMMING Разбор Educational Codeforces Round 68 2500
8193 Submarine in the Rybinsk Sea (easy edition) combinatorics math number theory Statement D1 Codeforces Round 574 (Div. 2) {1195} PROGRAMMING Разбор Codeforces Round #574 (Div. 2) 1500
4896 Submarine in the Rybinsk Sea (hard edition) combinatorics math number theory Statement D2 Codeforces Round 574 (Div. 2) {1195} PROGRAMMING Разбор Codeforces Round #574 (Div. 2) 1700
2046 Natasha, Sasha and the Prefix Sums combinatorics dp math number theory Statement E Codeforces Round 581 (Div. 2) {1204} PROGRAMMING 69244 2400
7790 Ivan the Fool and the Probability Theory combinatorics dp math Statement A Codeforces Round 594 (Div. 1) {1239} PROGRAMMING Editorial of Codeforces Round #594 (on the problems of Moscow Team Olympiad) 1700
2470 Cards combinatorics dp math number theory probabilities Statement F Educational Codeforces Round 78 (Rated for Div. 2) {1278} PROGRAMMING Educational Codeforces Round 78 Editorial 2600
1341 Classical? binary search combinatorics number theory Statement F Codeforces Round 613 (Div. 2) {1285} PROGRAMMING Codeforces Round #613 (Div. 2) Editorial 2800
18670 Kuroni and Impossible Calculation brute force combinatorics math number theory Statement C Ozon Tech Challenge 2020 (Div.1 + Div.2, Rated, T-shirts + prizes!) {1305} PROGRAMMING 1250.0 Ozon Tech Challenge 2020 Editorial 1600
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
6722 Modular Stability combinatorics math number theory Statement E Educational Codeforces Round 88 (Rated for Div. 2) {1359} PROGRAMMING Educational Codeforces Round 88 Editorial 2000
5523 Asterism (Easy Version) brute force combinatorics implementation math number theory sortings Statement E1 Codeforces Round 654 (Div. 2) {1371} PROGRAMMING 1500.0 Codeforces Round #654 (Div. 2) Editorial
621 Sum Over Subsets combinatorics math number theory Statement F Codeforces Round 678 (Div. 2) {1436} PROGRAMMING 3000.0 Codeforces Round #678 (Div. 2). Editorial
2703 Mocha and Stars combinatorics dp fft math number theory Statement E Codeforces Round 738 (Div. 2) {1559} PROGRAMMING 3000.0 Tutorial (en) 2200
3003 Not Quite Lee combinatorics math number theory Statement D Codeforces Global Round 17 {1610} PROGRAMMING 2250.0 Codeforces Global Round 17 Editorial
900 A Random Code Problem combinatorics dp math number theory Statement F Educational Codeforces Round 121 (Rated for Div. 2) {1626} PROGRAMMING 99136
552 Expected Components combinatorics number theory probabilities Statement E Codeforces Round 768 (Div. 1) {1630} PROGRAMMING 2500.0 Editorial of Codeforces Round #768
427 Basis combinatorics fft math number theory Statement F Educational Codeforces Round 123 (Rated for Div. 2) {1644} PROGRAMMING 100227
3622 Lost Arithmetic Progression combinatorics implementation math number theory Statement D Codeforces Round 785 (Div. 2) {1673} PROGRAMMING 2000.0 Codeforces Round #785 (Div. 2) Editorial
800 Power or XOR? combinatorics math number theory Statement E Codeforces Round 785 (Div. 2) {1673} PROGRAMMING 2750.0 Codeforces Round #785 (Div. 2) Editorial
309 Become Big For Me combinatorics constructive algorithms math number theory Statement E Codeforces Round 796 (Div. 1) {1687} PROGRAMMING 2000.0 Editorial of Codeforces Round 796
2457 LCM Sum (easy version) binary search brute force combinatorics math number theory two pointers Statement E1 Codeforces Round 813 (Div. 2) {1712} PROGRAMMING 2000.0 Codeforces Round #813 (Div. 2) Editorial
1612 LCM Sum (hard version) combinatorics data structures math number theory two pointers Statement E2 Codeforces Round 813 (Div. 2) {1712} PROGRAMMING 750.0 Codeforces Round #813 (Div. 2) Editorial
1360 Bags with Balls combinatorics math number theory Statement F Educational Codeforces Round 133 (Rated for Div. 2) {1716} PROGRAMMING 105653
595 Electrical Efficiency combinatorics data structures dp number theory trees Statement E COMPFEST 14 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) {1725} PROGRAMMING Tutorial
764 Maximums and Minimums combinatorics combinatorics data structures number theory Statement E Codeforces Round 823 (Div. 2) {1730} PROGRAMMING 2250.0 Codeforces Round #823 — editorial 2700
3242 ConstructOR bitmasks chinese remainder theorem combinatorics constructive algorithms number theory Statement D Codeforces Round 833 (Div. 2) {1748} PROGRAMMING 2000.0 Codeforces Round #833 (Div. 2) Editorial 2100
7334 Count GCD bitmasks combinatorics dp math number theory Statement D CodeTON Round 3 (Div. 1 + Div. 2, Rated, Prizes!) {1750} PROGRAMMING 1750.0 CodeTON Round 3 (Div. 1 + Div. 2) Editorial
2261 Partial Sorting combinatorics fft math number theory Statement E Codeforces Round 842 (Div. 2) {1768} PROGRAMMING 2250.0 Codeforces Round #842 (Div. 2) Editorial
1897 Three Chairs bitmasks brute force combinatorics data structures number theory sortings Statement F Codeforces Round 846 (Div. 2) {1780} PROGRAMMING 2000.0 111841
964 Serval and Music Game brute force combinatorics implementation math number theory Statement E Codeforces Round 853 (Div. 2) {1789} PROGRAMMING 2000.0 Codeforces Round #853 (Div. 2) Editorial
4450 Counting Factorizations combinatorics dp math number theory Statement D Codeforces Round 856 (Div. 2) {1794} PROGRAMMING 2000.0 Codeforces Round 856 (Div. 2) Editorial
2168 Hyperregular Bracket Strings combinatorics hashing number theory sortings two pointers Statement C Codeforces Round 875 (Div. 1) {1830} PROGRAMMING 1750.0 Codeforces Round #875 (Div.1 + 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)
9154 Battling with Numbers combinatorics math number theory Statement B COMPFEST 15 - Preliminary Online Mirror (Unrated, ICPC Rules, Teams Preferred) {1866} PROGRAMMING COMPFEST 15 Preliminary — Editorial
10009 Effects of Anti Pimples combinatorics number theory sortings Statement B Codeforces Round 902 (Div. 1, based on COMPFEST 15 - Final Round) {1876} PROGRAMMING 1000.0 Codeforces Round #902 (Div. 1, Div. 2, based on COMPFEST 15 — Final Round) Editorial
4030 Counting Rhyme brute force combinatorics dp math number theory sortings Statement D Codeforces Round 904 (Div. 2) {1884} PROGRAMMING 2500.0 Codeforces Round #904 (Div. 2) Editorial
15661 Good Triples brute force combinatorics number theory Statement E Codeforces Round 913 (Div. 3) {1907} PROGRAMMING Codeforces Round 913 (Div. 3) Editorial
3624 One-Dimensional Puzzle combinatorics constructive algorithms math number theory Statement G Codeforces Round 925 (Div. 3) {1931} PROGRAMMING 125878
1177 Turtle Magic: Royal Turtle Shell Pattern bitmasks brute force combinatorics math Statement G Codeforces Round 929 (Div. 3) {1933} PROGRAMMING Codeforces Round 929 (Div. 3) Editorial
3165 Girl Permutation combinatorics dp math number theory Statement E Codeforces Round 936 (Div. 2) {1946} PROGRAMMING 2250.0 Codeforces Round #936 (Div. 2) Editorial
1616 Carousel of Combinations brute force combinatorics dp math number theory Statement E Codeforces Round 940 (Div. 2) and CodeCraft-23 {1957} PROGRAMMING 2250.0 Codeforces Round #940 and CodeCraft-23 (Div. 2) Editorial 2400
22139 Earning on Bets binary search combinatorics constructive algorithms number theory Statement C Codeforces Round 951 (Div. 2) {1979} PROGRAMMING 1500.0 Codeforces Round 951 (Div. 2) Editorial
12165 D-Function bitmasks combinatorics math number theory Statement G Codeforces Round 952 (Div. 4) {1985} PROGRAMMING Codeforces Round 952 (Div. 4) Editorial
1905 Permutation Problem (Simple Version) brute force combinatorics math number theory Statement G1 Codeforces Round 954 (Div. 3) {1986} PROGRAMMING 130762
4130 Ultra-Meow combinatorics math number theory Statement G Codeforces Round 957 (Div. 3) {1992} PROGRAMMING Shayan's Video Tutorial
3712 Natlan Exploring combinatorics dp math number theory Statement G Codeforces Round 988 (Div. 3) {2037} PROGRAMMING Video Tutorial
500 Shohag Loves Counting (Easy Version) combinatorics dp math number theory Statement F1 CodeTON Round 9 (Div. 1 + Div. 2, Rated, Prizes!) {2039} PROGRAMMING 2000.0 Editorial of CodeTON Round 9 (Div. 1 + Div. 2)
449 Number of Cubes combinatorics math number theory Statement F Codeforces Round 992 (Div. 2) {2040} PROGRAMMING 2750.0 Codeforces Round #992 (Div.2) Editorial
8401 Goodbye, Banker Life bitmasks combinatorics constructive algorithms math number theory Statement F Codeforces Round 1006 (Div. 3) {2072} PROGRAMMING Codeforces Round 1006 (Div. 3) 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
22611 Count Good Numbers combinatorics math number theory Statement C 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
155 Beyond the Palindrome (Hard Version) combinatorics dp math number theory Statement E2 Codeforces Round 1046 (Div. 1) {2135} PROGRAMMING 2000.0 Codeforces Round 1046 (Div. 1, Div. 2) Editorial
353 Modular Tetration combinatorics math number theory Statement G Codeforces Global Round 29 (Div. 1 + Div. 2) {2147} PROGRAMMING 4500.0
749 Attraction Theory combinatorics dp implementation math Statement D Codeforces Round 1053 (Div. 1) {2150} PROGRAMMING 2500.0 Editorial of Codeforces Round 1053 (Div. 1, Div. 2)
209 Distinct GCDs (Hard Version) combinatorics constructive algorithms graphs graphs graphs math number theory number theory Statement F2 Codeforces Round 1067 (Div. 2) {2158} PROGRAMMING 1000.0 Codeforces Round 1067 (Div. 2) 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
941 Prufer Vertex combinatorics dsu number theory probabilities trees Statement D Codeforces Round 1073 (Div. 1) {2190} PROGRAMMING 2250.0 Codeforces Round 1073 (Div. 1, Div. 2) Editorial