Skip to content

About

800+ C++ solutions I have solved for various competitions CSES, Codeforces, and AtCoder, with algorithm notes, tests, and reusable data structures.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Pro Competitive Programming

My C++17 algorithm collection: 835 reference implementations from CSES, Codeforces, and AtCoder, with explanations, complexity bounds, and local tests.

Each source compiles on its own using standard headers. The Python runner checks fixed cases, validates answers that have multiple correct forms, and compares selected algorithms with small brute-force models.

Verify C++ archive

Start here

These examples show the implementation choices behind the collection:

Problem Implementation choice Read
Counting Rooms An explicit stack avoids recursion depth proportional to the grid size; cells are marked before pushing. Code · Explanation
Dynamic Range Sum Queries A Fenwick tree stores 64-bit sums; assignments become deltas from the previous value. Code · Explanation
Labyrinth BFS stores predecessor directions; the checker accepts any shortest valid route. Code · Explanation

Run an example with Python 3.10+ and a C++17 compiler; no Python packages are required:

git clone https://github.com/michaelbawuah/Pro-Competitive-Programming.git
cd Pro-Competitive-Programming
python3 tools/cp.py test cses-1193
python3 tools/cp.py list --tag graphs

The reusable algorithm library covers DSU, Fenwick trees, segment trees, and KMP. Its tests include empty ranges, overlapping matches, and merge ordering.

Browse the collection

Platform Solutions Browse
CSES 96 Problem tables · Source files
Codeforces 114 Problem tables · Source files
AtCoder 625 Problem tables · Source files
Total 835 Complete index with time and space complexity

Algorithm library · C++ notes · Practice route · Run locally · Verification

Problem names link to the original judge. C++17 opens the implementation; Notes explains the approach and complexity. Expand a section to browse its problems.

CSES

Solutions from the CSES Problem Set, grouped by topic.

Introductory Problems · 18 solutions
ID Problem Technique Solution
1068 Weird Algorithm simulation, integers C++17 · Notes
1083 Missing Number arithmetic, integers C++17 · Notes
1069 Repetitions strings, scan C++17 · Notes
1094 Increasing Array greedy, scan C++17 · Notes
1617 Bit Strings modular arithmetic, binary exponentiation C++17 · Notes
1618 Trailing Zeros number theory C++17 · Notes
1070 Permutations construction, parity C++17 · Notes
1071 Number Spiral arithmetic, pattern C++17 · Notes
1072 Two Knights combinatorics C++17 · Notes
1092 Two Sets construction, greedy C++17 · Notes
1755 Palindrome Reorder strings, construction, counting C++17 · Notes
1754 Coin Piles arithmetic, invariants C++17 · Notes
2205 Gray Code bit operations, construction C++17 · Notes
2165 Tower of Hanoi recursion, construction C++17 · Notes
1622 Creating Strings permutations, STL C++17 · Notes
1623 Apple Division backtracking, subset enumeration C++17 · Notes
1624 Chessboard and Queens backtracking, constraints C++17 · Notes
2431 Digit Queries arithmetic, digit blocks C++17 · Notes
Sorting and Searching · 25 solutions
ID Problem Technique Solution
1621 Distinct Numbers sorting, STL C++17 · Notes
1084 Apartments sorting, two pointers, greedy C++17 · Notes
1090 Ferris Wheel greedy, two pointers C++17 · Notes
1629 Movie Festival greedy, interval scheduling C++17 · Notes
1643 Maximum Subarray Sum dynamic programming, Kadane C++17 · Notes
1620 Factory Machines binary search, monotone predicate C++17 · Notes
1141 Playlist sliding window, map C++17 · Notes
1661 Subarray Sums II prefix sums, map C++17 · Notes
1091 Concert Tickets multiset, binary search C++17 · Notes
1619 Restaurant Customers sweep line, sorting C++17 · Notes
1074 Stick Lengths sorting, median C++17 · Notes
2183 Missing Coin Sum greedy, coverage invariant C++17 · Notes
2216 Collecting Numbers inverse permutation, scan C++17 · Notes
1073 Towers binary search, greedy C++17 · Notes
1163 Traffic Lights ordered set, multiset, intervals C++17 · Notes
1630 Tasks and Deadlines greedy, scheduling C++17 · Notes
1631 Reading Books greedy, lower bounds C++17 · Notes
1645 Nearest Smaller Values monotonic stack C++17 · Notes
1660 Subarray Sums I sliding window C++17 · Notes
1662 Subarray Divisibility prefix sums C++17 · Notes
2428 Distinct Values Subarrays II sliding window C++17 · Notes
1085 Array Division binary search C++17 · Notes
1644 Maximum Subarray Sum II prefix sums C++17 · Notes
1632 Movie Festival II greedy C++17 · Notes
1652 Forest Queries prefix sums C++17 · Notes
Dynamic Programming · 18 solutions
ID Problem Technique Solution
1633 Dice Combinations dynamic programming, counting C++17 · Notes
1634 Minimizing Coins dynamic programming, unbounded knapsack C++17 · Notes
1636 Coin Combinations II dynamic programming, counting C++17 · Notes
1158 Book Shop dynamic programming, 0/1 knapsack C++17 · Notes
1639 Edit Distance dynamic programming, strings C++17 · Notes
1145 Increasing Subsequence binary search, dynamic programming C++17 · Notes
1635 Coin Combinations I dynamic programming, counting C++17 · Notes
1637 Removing Digits dynamic programming, digits C++17 · Notes
1638 Grid Paths I dynamic programming, grid C++17 · Notes
1746 Array Description dynamic programming, counting C++17 · Notes
1744 Rectangle Cutting dynamic programming C++17 · Notes
1745 Money Sums dynamic programming, subset sum C++17 · Notes
1093 Two Sets II dynamic programming, subset sum, counting C++17 · Notes
1140 Projects dynamic programming, sorting, binary search C++17 · Notes
2413 Counting Towers dynamic programming C++17 · Notes
1097 Removal Game dynamic programming C++17 · Notes
1653 Elevator Rides bitmask DP C++17 · Notes
2181 Counting Tilings profile DP C++17 · Notes
Graph Algorithms · 10 solutions
ID Problem Technique Solution
1192 Counting Rooms graphs, flood fill, iterative DFS C++17 · Notes
1668 Building Teams graphs, BFS, bipartite C++17 · Notes
1671 Shortest Routes I graphs, Dijkstra, priority queue C++17 · Notes
1675 Road Reparation graphs, Kruskal, DSU C++17 · Notes
1679 Course Schedule graphs, topological sort C++17 · Notes
1672 Shortest Routes II graphs, shortest path, Floyd–Warshall C++17 · Notes
1195 Flight Discount graphs, shortest path, Dijkstra, state expansion C++17 · Notes
1676 Road Construction graphs, disjoint set C++17 · Notes
1681 Game Routes graphs, dynamic programming, topological sort C++17 · Notes
1193 Labyrinth graphs, BFS, grid, path reconstruction C++17 · Notes
Range Queries · 10 solutions
ID Problem Technique Solution
1646 Static Range Sum Queries prefix sums, range queries C++17 · Notes
1648 Dynamic Range Sum Queries Fenwick tree, range queries C++17 · Notes
1649 Dynamic Range Minimum Queries segment tree, range queries C++17 · Notes
1650 Range Xor Queries prefix XOR, range queries C++17 · Notes
1651 Range Update Queries Fenwick tree, difference array, range queries C++17 · Notes
1144 Salary Queries Fenwick tree C++17 · Notes
1647 Static Range Minimum Queries sparse table C++17 · Notes
1143 Hotel Queries segment tree C++17 · Notes
1749 List Removals segment tree C++17 · Notes
1137 Subtree Queries Fenwick tree C++17 · Notes
Tree Algorithms · 7 solutions
ID Problem Technique Solution
1674 Subordinates trees, subtree, iterative traversal C++17 · Notes
1131 Tree Diameter trees, BFS, diameter C++17 · Notes
1132 Tree Distances I trees, BFS, diameter C++17 · Notes
1687 Company Queries I trees, binary lifting C++17 · Notes
1133 Tree Distances II trees C++17 · Notes
1135 Distance Queries trees C++17 · Notes
1688 Company Queries II trees C++17 · Notes
Mathematics · 5 solutions
ID Problem Technique Solution
1095 Exponentiation mathematics, modular arithmetic, binary exponentiation C++17 · Notes
1713 Counting Divisors mathematics, divisors, sieve C++17 · Notes
1081 Common Divisors mathematics, divisors, sieve C++17 · Notes
1712 Exponentiation II mathematics, modular arithmetic, binary exponentiation, Fermat C++17 · Notes
1722 Fibonacci Numbers number theory C++17 · Notes
String Algorithms · 3 solutions
ID Problem Technique Solution
1753 String Matching strings, KMP, prefix function C++17 · Notes
1732 Finding Borders strings, prefix function, KMP C++17 · Notes
1733 Finding Periods strings, Z-function, periods C++17 · Notes

Codeforces

Solutions from the Codeforces problemset, ordered by contest number and problem letter.

Codeforces Problems · 114 solutions
ID Problem Technique Solution
4A Watermelon arithmetic, conditions C++17 · Notes
25A IQ test counting C++17 · Notes
41A Translation strings C++17 · Notes
50A Domino Piling mathematics, constructive C++17 · Notes
59A Word strings, counting C++17 · Notes
61A Ultra-Fast Mathematician strings C++17 · Notes
69A Young Physicist mathematics C++17 · Notes
71A Way Too Long Words strings, implementation C++17 · Notes
96A Football strings C++17 · Notes
110A Nearly Lucky Number strings C++17 · Notes
112A Petya and Strings strings, implementation C++17 · Notes
116A Tram implementation, prefix sum C++17 · Notes
122A Lucky Division enumeration C++17 · Notes
133A HQ9+ strings C++17 · Notes
136A Presents arrays C++17 · Notes
144A Arrival of the General greedy C++17 · Notes
148A Insomnia cure enumeration C++17 · Notes
151A Soft Drinking mathematics C++17 · Notes
155A I_love_%username% arrays C++17 · Notes
158A Next Round arrays, conditions C++17 · Notes
160A Twins greedy C++17 · Notes
200B Drinks mathematics C++17 · Notes
228A Is your horseshoe on the other hoof? counting C++17 · Notes
230A Dragons greedy C++17 · Notes
231A Team counting, implementation C++17 · Notes
236A Boy or Girl strings C++17 · Notes
266A Stones on the Table strings C++17 · Notes
266B Queue at the School simulation C++17 · Notes
268A Games enumeration C++17 · Notes
271A Beautiful Year enumeration C++17 · Notes
281A Word Capitalization strings, implementation C++17 · Notes
282A Bit++ implementation, strings C++17 · Notes
318A Even Odds mathematics C++17 · Notes
337A Puzzles sorting C++17 · Notes
339A Helpful Maths strings, sorting C++17 · Notes
344A Magnets simulation C++17 · Notes
405A Gravity Flip sorting C++17 · Notes
432A Choosing Teams counting C++17 · Notes
443A Anton and Letters strings C++17 · Notes
467A George and Accommodation counting C++17 · Notes
469A I Wanna Be the Guy sets C++17 · Notes
472A Design Tutorial: Learn from Math constructive C++17 · Notes
486A Calculating Function mathematics C++17 · Notes
492A Vanya and Cubes simulation C++17 · Notes
520A Pangram strings C++17 · Notes
546A Soldier and Bananas mathematics, arithmetic series C++17 · Notes
581A Vasya the Hipster mathematics C++17 · Notes
617A Elephant mathematics, greedy C++17 · Notes
677A Vanya and Fence implementation C++17 · Notes
703A Mishka and Game simulation C++17 · Notes
705A Hulk strings C++17 · Notes
731A Night at the Museum greedy C++17 · Notes
732A Buy a Shovel enumeration C++17 · Notes
734A Anton and Danik counting C++17 · Notes
758A Holiday Of Equality greedy C++17 · Notes
791A Bear and Big Brother simulation C++17 · Notes
977A Wrong Subtraction implementation, digits C++17 · Notes
996A Hit the Lottery greedy C++17 · Notes
1030A In Search of an Easy Problem implementation C++17 · Notes
1097A Gennady and a Card Game strings C++17 · Notes
1154A Restoring Three Numbers mathematics C++17 · Notes
1294A Collecting Coins mathematics C++17 · Notes
1328A Divisibility Problem mathematics C++17 · Notes
1343A Candies mathematics C++17 · Notes
1343B Balanced Array constructive C++17 · Notes
1352A Sum of Round Numbers mathematics C++17 · Notes
1353A Most Unstable Array mathematics C++17 · Notes
1353B Two Arrays And Swaps greedy C++17 · Notes
1360A Minimal Square geometry C++17 · Notes
1360B Honest Coach sorting C++17 · Notes
1367A Short Substrings strings C++17 · Notes
1367B Even Array greedy C++17 · Notes
1367C Social Distance greedy C++17 · Notes
1374A Required Remainder mathematics C++17 · Notes
1374B Multiply by 2, divide by 6 number theory C++17 · Notes
1399A Remove Smallest sorting C++17 · Notes
1399B Gifts Fixing greedy C++17 · Notes
1399C Boats Competition two pointers C++17 · Notes
1409A Yet Another Two Integers Problem mathematics C++17 · Notes
1472A Cards for Friends mathematics C++17 · Notes
1472B Fair Division mathematics C++17 · Notes
1472C Long Jumps dynamic programming C++17 · Notes
1520A Do Not Be Distracted! strings C++17 · Notes
1520B Ordinary Numbers enumeration C++17 · Notes
1520D Same Differences counting C++17 · Notes
1535A Fair Playoff mathematics C++17 · Notes
1542A Odd Set counting C++17 · Notes
1547A Shortest Path with Obstacle geometry C++17 · Notes
1547B Alphabetical Strings strings C++17 · Notes
1560A Dislike of Threes enumeration C++17 · Notes
1560B Who's Opposite? mathematics C++17 · Notes
1560C Infinity Table mathematics C++17 · Notes
1582A Luntik and Concerts mathematics C++17 · Notes
1582B Luntik and Subsequences counting C++17 · Notes
1593A Elections mathematics C++17 · Notes
1607A Linear Keyboard strings C++17 · Notes
1607B Odd Grasshopper mathematics C++17 · Notes
1619A Square String? strings C++17 · Notes
1624A Plus One on the Subset greedy C++17 · Notes
1624B Make AP mathematics C++17 · Notes
1633A Div. 7 constructive C++17 · Notes
1669A Division? implementation C++17 · Notes
1669B Triple counting C++17 · Notes
1669C Odd/Even Increments invariants C++17 · Notes
1676A Lucky? strings C++17 · Notes
1676B Equal Candies greedy C++17 · Notes
1676C Most Similar Words enumeration C++17 · Notes
1676D X-Sum prefix sums C++17 · Notes
1692A Marathon counting C++17 · Notes
1692B All Distinct greedy C++17 · Notes
1692C Where's the Bishop? grid C++17 · Notes
1703A YES or YES? strings C++17 · Notes
1703B ICPC Balloons counting C++17 · Notes
1703C Cypher simulation C++17 · Notes

AtCoder

Solutions from AtCoder, grouped by contest series. ABC sections use contest-number ranges for easier navigation.

Educational DP Contest · 10 solutions
ID Problem Technique Solution
DP A Frog 1 dynamic programming, shortest path in DAG C++17 · Notes
DP B Frog 2 dynamic programming, bounded transitions C++17 · Notes
DP C Vacation dynamic programming, state compression C++17 · Notes
DP D Knapsack 1 dynamic programming, knapsack C++17 · Notes
DP E Knapsack 2 dynamic programming, knapsack C++17 · Notes
DP F LCS dynamic programming, strings, reconstruction C++17 · Notes
DP G Longest Path dynamic programming, graphs, topological sort C++17 · Notes
DP H Grid 1 dynamic programming, grid C++17 · Notes
DP I Coins dynamic programming, probability C++17 · Notes
DP K Stones dynamic programming, game theory C++17 · Notes
AtCoder Beginner Contest 001–099 · 15 solutions
ID Problem Technique Solution
ABC049 C Daydream dynamic programming C++17 · Notes
ABC081 A Placing Marbles implementation C++17 · Notes
ABC081 B Shift only implementation C++17 · Notes
ABC083 B Some Sums implementation C++17 · Notes
ABC085 B Kagami Mochi implementation C++17 · Notes
ABC086 A Product implementation C++17 · Notes
ABC086 C Traveling implementation C++17 · Notes
ABC087 B Coins implementation C++17 · Notes
ABC087 C Candies prefix sums C++17 · Notes
ABC088 B Card Game for Two implementation C++17 · Notes
ABC088 C Takahashi's Information implementation C++17 · Notes
ABC093 C Same Integers implementation C++17 · Notes
ABC095 C Half and Half implementation C++17 · Notes
ABC098 C Attention prefix sums C++17 · Notes
ABC099 C Strange Bank dynamic programming C++17 · Notes
AtCoder Beginner Contest 100–199 · 258 solutions
ID Problem Technique Solution
ABC100 A Happy Birthday! implementation C++17 · Notes
ABC100 B Ringo's Favorite Numbers implementation C++17 · Notes
ABC100 C *3 or /2 implementation C++17 · Notes
ABC101 A Eating Symbols Easy implementation C++17 · Notes
ABC101 B Digit Sums implementation C++17 · Notes
ABC102 A Multiple of 2 and N implementation C++17 · Notes
ABC102 B Maximum Difference implementation C++17 · Notes
ABC102 C Linear Approximation sorting C++17 · Notes
ABC103 A Task Scheduling Problem implementation C++17 · Notes
ABC103 B String Rotation implementation C++17 · Notes
ABC103 C Modulo Summation implementation C++17 · Notes
ABC104 A Rated for Me implementation C++17 · Notes
ABC104 B AcCepted implementation C++17 · Notes
ABC104 C All Green bitmasks C++17 · Notes
ABC105 A AtCoder Crackers implementation C++17 · Notes
ABC105 B Cakes and Donuts implementation C++17 · Notes
ABC106 A Garden implementation C++17 · Notes
ABC106 B 105 implementation C++17 · Notes
ABC106 C To Infinity implementation C++17 · Notes
ABC107 A Train implementation C++17 · Notes
ABC107 B Grid Compression implementation C++17 · Notes
ABC107 C Candles sliding window C++17 · Notes
ABC108 A Pair implementation C++17 · Notes
ABC108 B Ruined Square implementation C++17 · Notes
ABC108 C Triangular Relationship implementation C++17 · Notes
ABC109 A ABC333 implementation C++17 · Notes
ABC109 B Shiritori implementation C++17 · Notes
ABC110 A Maximize the Formula implementation C++17 · Notes
ABC110 B 1 Dimensional World's Tale implementation C++17 · Notes
ABC111 A AtCoder Beginner Contest 999 implementation C++17 · Notes
ABC111 B AtCoder Beginner Contest 111 implementation C++17 · Notes
ABC111 C //// implementation C++17 · Notes
ABC112 A Programming Education implementation C++17 · Notes
ABC112 B Time Limit Exceeded implementation C++17 · Notes
ABC113 A Discount Fare implementation C++17 · Notes
ABC113 B Palace implementation C++17 · Notes
ABC113 C ID sorting C++17 · Notes
ABC114 A 753 implementation C++17 · Notes
ABC114 B 754 implementation C++17 · Notes
ABC114 C 755 recursion C++17 · Notes
ABC115 A Christmas Eve Eve Eve implementation C++17 · Notes
ABC115 B Christmas Eve Eve implementation C++17 · Notes
ABC115 C Christmas Eve sorting C++17 · Notes
ABC116 A Right Triangle implementation C++17 · Notes
ABC116 B Collatz Problem implementation C++17 · Notes
ABC116 C Grand Garden greedy C++17 · Notes
ABC117 A Entrance Examination implementation C++17 · Notes
ABC117 B Polygon implementation C++17 · Notes
ABC117 C Streamline greedy C++17 · Notes
ABC118 A B +/- A implementation C++17 · Notes
ABC118 B Foods Loved by Everyone implementation C++17 · Notes
ABC118 C Monsters Battle Royale number theory C++17 · Notes
ABC119 A Still TBD implementation C++17 · Notes
ABC119 B Digital Gifts implementation C++17 · Notes
ABC119 C Synthetic Kadomatsu enumeration C++17 · Notes
ABC120 A Favorite Sound implementation C++17 · Notes
ABC120 B K-th Common Divisor implementation C++17 · Notes
ABC120 C Unification implementation C++17 · Notes
ABC121 A White Cells implementation C++17 · Notes
ABC121 B Can you solve this? implementation C++17 · Notes
ABC121 C Energy Drink Collector greedy C++17 · Notes
ABC122 A Double Helix implementation C++17 · Notes
ABC122 B ATCoder implementation C++17 · Notes
ABC122 C GeT AC prefix sums C++17 · Notes
ABC123 A Five Antennas implementation C++17 · Notes
ABC123 B Five Dishes implementation C++17 · Notes
ABC123 C Five Transportations implementation C++17 · Notes
ABC124 A Buttons implementation C++17 · Notes
ABC124 B Great Ocean View implementation C++17 · Notes
ABC124 C Coloring Colorfully implementation C++17 · Notes
ABC125 A Biscuit Generator implementation C++17 · Notes
ABC125 B Resale implementation C++17 · Notes
ABC125 C GCD on Blackboard prefix sums C++17 · Notes
ABC126 A Changing a Character implementation C++17 · Notes
ABC126 B YYMM or MMYY implementation C++17 · Notes
ABC126 C Dice and Coin probability C++17 · Notes
ABC127 A Ferris Wheel implementation C++17 · Notes
ABC127 B Algae implementation C++17 · Notes
ABC127 C Prison implementation C++17 · Notes
ABC128 A Apple Pie implementation C++17 · Notes
ABC128 B Guidebook implementation C++17 · Notes
ABC128 C Switches bitmasks C++17 · Notes
ABC129 A Airplane implementation C++17 · Notes
ABC129 B Balance implementation C++17 · Notes
ABC129 C Typical Stairs dynamic programming C++17 · Notes
ABC130 A Rounding implementation C++17 · Notes
ABC130 B Bounding implementation C++17 · Notes
ABC131 A Security implementation C++17 · Notes
ABC131 B Bite Eating implementation C++17 · Notes
ABC131 C Anti-Division number theory C++17 · Notes
ABC132 A Fifty-Fifty implementation C++17 · Notes
ABC132 B Ordinary Number implementation C++17 · Notes
ABC132 C Divide the Problems sorting C++17 · Notes
ABC133 A T or T implementation C++17 · Notes
ABC133 B Good Distance implementation C++17 · Notes
ABC133 C Remainder Minimization 2019 implementation C++17 · Notes
ABC134 A Dodecagon implementation C++17 · Notes
ABC134 B Golden Apple implementation C++17 · Notes
ABC134 C Exception Handling sorting C++17 · Notes
ABC135 A Harmony implementation C++17 · Notes
ABC135 B 0 or 1 Swap implementation C++17 · Notes
ABC135 C City Savers greedy C++17 · Notes
ABC136 A Transfer implementation C++17 · Notes
ABC136 B Uneven Numbers implementation C++17 · Notes
ABC136 C Build Stairs greedy C++17 · Notes
ABC137 A +-x implementation C++17 · Notes
ABC137 B One Clue implementation C++17 · Notes
ABC137 C Green Bin counting C++17 · Notes
ABC138 A Red or Not implementation C++17 · Notes
ABC138 B Resistors in Parallel implementation C++17 · Notes
ABC139 A Tenki implementation C++17 · Notes
ABC139 B Power Socket implementation C++17 · Notes
ABC139 C Lower implementation C++17 · Notes
ABC140 A Password implementation C++17 · Notes
ABC140 B Buffet implementation C++17 · Notes
ABC140 C Maximal Value implementation C++17 · Notes
ABC141 A Weather Prediction implementation C++17 · Notes
ABC141 B Tap Dance implementation C++17 · Notes
ABC141 C Attack Survival implementation C++17 · Notes
ABC142 A Odds of Oddness implementation C++17 · Notes
ABC142 B Roller Coaster implementation C++17 · Notes
ABC142 C Go to School implementation C++17 · Notes
ABC143 A Curtain implementation C++17 · Notes
ABC143 B TAKOYAKI FESTIVAL 2019 implementation C++17 · Notes
ABC143 C Slimes implementation C++17 · Notes
ABC144 A 9x9 implementation C++17 · Notes
ABC144 B 81 implementation C++17 · Notes
ABC144 C Walk on Multiplication Table number theory C++17 · Notes
ABC145 A Circle implementation C++17 · Notes
ABC145 B Echo implementation C++17 · Notes
ABC146 A Can't Wait for Holiday implementation C++17 · Notes
ABC146 B ROT N implementation C++17 · Notes
ABC146 C Buy an Integer binary search C++17 · Notes
ABC147 A Blackjack implementation C++17 · Notes
ABC147 B Palindrome-philia implementation C++17 · Notes
ABC147 C HonestOrUnkind2 bitmasks C++17 · Notes
ABC148 A Round One implementation C++17 · Notes
ABC148 B Strings with the Same Length implementation C++17 · Notes
ABC148 C Snack number theory C++17 · Notes
ABC149 A Strings implementation C++17 · Notes
ABC149 B Greedy Takahashi implementation C++17 · Notes
ABC149 C Next Prime number theory C++17 · Notes
ABC150 A 500 Yen Coins implementation C++17 · Notes
ABC150 B Count ABC implementation C++17 · Notes
ABC150 C Count Order enumeration C++17 · Notes
ABC151 A Next Alphabet implementation C++17 · Notes
ABC151 B Achieve the Goal implementation C++17 · Notes
ABC151 C Welcome to AtCoder implementation C++17 · Notes
ABC152 A AC or WA implementation C++17 · Notes
ABC152 B Comparing Strings implementation C++17 · Notes
ABC152 C Low Elements implementation C++17 · Notes
ABC153 A Serval vs Monster implementation C++17 · Notes
ABC153 B Common Raccoon vs Monster implementation C++17 · Notes
ABC153 C Fennec vs Monster greedy C++17 · Notes
ABC154 A Remaining Balls implementation C++17 · Notes
ABC154 B I miss you... implementation C++17 · Notes
ABC154 C Distinct or Not implementation C++17 · Notes
ABC155 A Poor implementation C++17 · Notes
ABC155 B Papers, Please implementation C++17 · Notes
ABC155 C Poll counting C++17 · Notes
ABC156 A Beginner implementation C++17 · Notes
ABC156 B Digits implementation C++17 · Notes
ABC156 C Rally implementation C++17 · Notes
ABC157 A Duplex Printing implementation C++17 · Notes
ABC157 B Bingo implementation C++17 · Notes
ABC157 C Guess The Number implementation C++17 · Notes
ABC158 A Station and Bus implementation C++17 · Notes
ABC158 B Count Balls implementation C++17 · Notes
ABC158 C Tax Increase implementation C++17 · Notes
ABC159 A The Number of Even Pairs implementation C++17 · Notes
ABC159 B String Palindrome implementation C++17 · Notes
ABC160 A Coffee implementation C++17 · Notes
ABC160 B Golden Coins implementation C++17 · Notes
ABC160 C Traveling Salesman around Lake greedy C++17 · Notes
ABC161 A ABC Swap implementation C++17 · Notes
ABC161 B Popular Vote implementation C++17 · Notes
ABC161 C Replacing Integer implementation C++17 · Notes
ABC162 A Lucky 7 implementation C++17 · Notes
ABC162 B FizzBuzz Sum implementation C++17 · Notes
ABC162 C Sum of gcd of Tuples (Easy) number theory C++17 · Notes
ABC163 A Circle Pond implementation C++17 · Notes
ABC163 B Homework implementation C++17 · Notes
ABC163 C management implementation C++17 · Notes
ABC164 A Sheep and Wolves implementation C++17 · Notes
ABC164 B Battle implementation C++17 · Notes
ABC164 C gacha implementation C++17 · Notes
ABC165 A We Love Golf implementation C++17 · Notes
ABC165 B 1% implementation C++17 · Notes
ABC165 C Many Requirements recursion C++17 · Notes
ABC166 A A?C implementation C++17 · Notes
ABC166 B Trick or Treat implementation C++17 · Notes
ABC166 C Peaks graphs C++17 · Notes
ABC167 A Registration implementation C++17 · Notes
ABC167 B Easy Linear Programming implementation C++17 · Notes
ABC168 A ∴ (Therefore) implementation C++17 · Notes
ABC168 B ... (Triple Dots) implementation C++17 · Notes
ABC169 A Multiplication 1 implementation C++17 · Notes
ABC169 B Multiplication 2 implementation C++17 · Notes
ABC170 A Five Variables implementation C++17 · Notes
ABC170 B Crane and Turtle implementation C++17 · Notes
ABC171 A αlphabet implementation C++17 · Notes
ABC171 B Mix Juice implementation C++17 · Notes
ABC172 A Calc implementation C++17 · Notes
ABC172 B Minor Change implementation C++17 · Notes
ABC173 A Payment implementation C++17 · Notes
ABC173 B Judge Status Summary implementation C++17 · Notes
ABC174 A Air Conditioner implementation C++17 · Notes
ABC174 B Distance implementation C++17 · Notes
ABC175 A Rainy Season implementation C++17 · Notes
ABC175 B Making Triangle implementation C++17 · Notes
ABC176 A Takoyaki implementation C++17 · Notes
ABC176 B Multiple of 9 implementation C++17 · Notes
ABC177 A Don't be late implementation C++17 · Notes
ABC177 B Substring implementation C++17 · Notes
ABC178 A Not implementation C++17 · Notes
ABC178 B Product Max implementation C++17 · Notes
ABC179 A Plural Form implementation C++17 · Notes
ABC179 B Go to Jail implementation C++17 · Notes
ABC180 A box implementation C++17 · Notes
ABC180 B Various distances implementation C++17 · Notes
ABC181 A Heavy Rotation implementation C++17 · Notes
ABC181 B Trapezoid Sum implementation C++17 · Notes
ABC182 A twiblr implementation C++17 · Notes
ABC182 B Almost GCD implementation C++17 · Notes
ABC183 A ReLU implementation C++17 · Notes
ABC183 B Billiards implementation C++17 · Notes
ABC184 A Determinant implementation C++17 · Notes
ABC184 B Quizzes implementation C++17 · Notes
ABC185 A ABC Preparation implementation C++17 · Notes
ABC185 B Smartphone Addiction implementation C++17 · Notes
ABC186 A Brick implementation C++17 · Notes
ABC186 B Blocks on Grid implementation C++17 · Notes
ABC187 A Large Digits implementation C++17 · Notes
ABC187 B Gentle Pairs implementation C++17 · Notes
ABC188 A Three-Point Shot implementation C++17 · Notes
ABC188 B Orthogonality implementation C++17 · Notes
ABC189 A Slot implementation C++17 · Notes
ABC189 B Alcoholic implementation C++17 · Notes
ABC190 A Very Very Primitive Game implementation C++17 · Notes
ABC190 B Magic 3 implementation C++17 · Notes
ABC191 A Vanishing Pitch implementation C++17 · Notes
ABC191 B Remove It implementation C++17 · Notes
ABC192 A Star implementation C++17 · Notes
ABC192 B uNrEaDaBlE sTrInG implementation C++17 · Notes
ABC193 A Discount implementation C++17 · Notes
ABC193 B Play Snuke implementation C++17 · Notes
ABC194 A I Scream implementation C++17 · Notes
ABC194 B Job Assignment implementation C++17 · Notes
ABC195 A Health M Death implementation C++17 · Notes
ABC195 B Many Oranges implementation C++17 · Notes
ABC196 A Difference Max implementation C++17 · Notes
ABC196 B Round Down implementation C++17 · Notes
ABC197 A Rotate implementation C++17 · Notes
ABC197 B Visibility implementation C++17 · Notes
ABC198 A Div implementation C++17 · Notes
ABC198 B Palindrome with leading zeros implementation C++17 · Notes
ABC199 A Square Inequality implementation C++17 · Notes
ABC199 B Intersection implementation C++17 · Notes
AtCoder Beginner Contest 200–299 · 200 solutions
ID Problem Technique Solution
ABC200 A Century implementation C++17 · Notes
ABC200 B 200th ABC-200 implementation C++17 · Notes
ABC201 A Tiny Arithmetic Sequence implementation C++17 · Notes
ABC201 B Do you know the second highest mountain? implementation C++17 · Notes
ABC202 A Three Dice implementation C++17 · Notes
ABC202 B 180° implementation C++17 · Notes
ABC203 A Chinchirorin implementation C++17 · Notes
ABC203 B AtCoder Condominium implementation C++17 · Notes
ABC204 A Rock-paper-scissors implementation C++17 · Notes
ABC204 B Nuts implementation C++17 · Notes
ABC205 A kcal implementation C++17 · Notes
ABC205 B Permutation Check implementation C++17 · Notes
ABC206 A Maxi-Buying implementation C++17 · Notes
ABC206 B Savings implementation C++17 · Notes
ABC207 A Repression implementation C++17 · Notes
ABC207 B Hydrate implementation C++17 · Notes
ABC208 A Rolling Dice implementation C++17 · Notes
ABC208 B Factorial Yen Coin implementation C++17 · Notes
ABC209 A Counting implementation C++17 · Notes
ABC209 B Can you buy them all? implementation C++17 · Notes
ABC210 A Cabbages implementation C++17 · Notes
ABC210 B Bouzu Mekuri implementation, strings C++17 · Notes
ABC211 A Blood Pressure implementation C++17 · Notes
ABC211 B Cycle Hit implementation, strings, ordered containers C++17 · Notes
ABC212 A Alloy implementation C++17 · Notes
ABC212 B Weak Password implementation, strings C++17 · Notes
ABC213 A Bitwise Exclusive Or implementation C++17 · Notes
ABC213 B Booby Prize implementation, sorting C++17 · Notes
ABC214 A New Generation ABC implementation C++17 · Notes
ABC214 B How many? implementation C++17 · Notes
ABC215 A Your First Judge implementation, strings C++17 · Notes
ABC215 B log2(N) implementation C++17 · Notes
ABC216 A Signed Difficulty implementation C++17 · Notes
ABC216 B Same Name implementation, strings, ordered containers C++17 · Notes
ABC217 A Lexicographic Order implementation, strings C++17 · Notes
ABC217 B AtCoder Quiz implementation, strings, ordered containers C++17 · Notes
ABC218 A Weather Forecast implementation, strings C++17 · Notes
ABC218 B qwerty implementation C++17 · Notes
ABC219 A AtCoder Quiz 2 implementation C++17 · Notes
ABC219 B Maritozzo implementation, strings C++17 · Notes
ABC220 A Find Multiple implementation C++17 · Notes
ABC220 B Base K implementation, strings C++17 · Notes
ABC221 A Seismic magnitude scales implementation C++17 · Notes
ABC221 B typo implementation, strings C++17 · Notes
ABC222 A Four Digits implementation C++17 · Notes
ABC222 B Failing Grade implementation C++17 · Notes
ABC223 A Exact Price implementation C++17 · Notes
ABC223 B String Shifting implementation, strings C++17 · Notes
ABC224 A Tires implementation, strings C++17 · Notes
ABC224 B Mongeness implementation, matrices C++17 · Notes
ABC225 A Distinct Strings implementation, strings, sorting C++17 · Notes
ABC225 B Star or Not implementation C++17 · Notes
ABC226 A Round decimals implementation, strings C++17 · Notes
ABC226 B Counting Arrays implementation, ordered containers C++17 · Notes
ABC227 A Last Card implementation C++17 · Notes
ABC227 B KEYENCE building implementation C++17 · Notes
ABC228 A On and Off implementation C++17 · Notes
ABC228 B Takahashi's Secret implementation C++17 · Notes
ABC229 A First Grid implementation, strings C++17 · Notes
ABC229 B Hard Calculation implementation C++17 · Notes
ABC230 A AtCoder Quiz 3 implementation C++17 · Notes
ABC230 B Triple Metre implementation, strings C++17 · Notes
ABC231 A Water Pressure implementation C++17 · Notes
ABC231 B Election implementation, strings, ordered containers C++17 · Notes
ABC232 A QQ solver implementation, strings C++17 · Notes
ABC232 B Caesar Cipher implementation, strings C++17 · Notes
ABC233 A 10yen Stamp implementation C++17 · Notes
ABC233 B A Reverse implementation, strings C++17 · Notes
ABC234 A Weird Function implementation C++17 · Notes
ABC234 B Longest Segment implementation C++17 · Notes
ABC235 A Rotate implementation, strings C++17 · Notes
ABC235 B Climbing Takahashi implementation C++17 · Notes
ABC236 A chukodai implementation, strings C++17 · Notes
ABC236 B Who is missing? implementation C++17 · Notes
ABC237 A Not Overflow implementation C++17 · Notes
ABC237 B Matrix Transposition implementation, matrices C++17 · Notes
ABC238 A Exponential or Quadratic implementation C++17 · Notes
ABC238 B Pizza implementation, sorting C++17 · Notes
ABC239 A Horizon implementation C++17 · Notes
ABC239 B Integer Division implementation C++17 · Notes
ABC240 A Edge Checker implementation C++17 · Notes
ABC240 B Count Distinct Integers implementation, ordered containers C++17 · Notes
ABC241 A Digit Machine implementation C++17 · Notes
ABC241 B Pasta implementation, ordered containers C++17 · Notes
ABC242 A T-shirt implementation C++17 · Notes
ABC242 B Minimize Ordering implementation, strings, sorting C++17 · Notes
ABC243 A Shampoo implementation C++17 · Notes
ABC243 B Hit and Blow implementation C++17 · Notes
ABC244 A Last Letter implementation, strings C++17 · Notes
ABC244 B Go Straight and Turn Right implementation, strings C++17 · Notes
ABC245 A Good morning implementation C++17 · Notes
ABC245 B Mex implementation C++17 · Notes
ABC246 A Four Points implementation C++17 · Notes
ABC246 B Get Closer implementation C++17 · Notes
ABC247 A Move Right implementation, strings C++17 · Notes
ABC247 B Unique Nicknames implementation, strings C++17 · Notes
ABC248 A Lacked Number implementation, strings C++17 · Notes
ABC248 B Slimes implementation C++17 · Notes
ABC249 A Jogging implementation C++17 · Notes
ABC249 B Perfect String implementation, strings, ordered containers C++17 · Notes
ABC250 A Adjacent Squares implementation C++17 · Notes
ABC250 B Enlarged Checker Board implementation C++17 · Notes
ABC251 A Six Characters implementation, strings C++17 · Notes
ABC251 B At Most 3 (Judge ver.) implementation C++17 · Notes
ABC252 A ASCII code implementation C++17 · Notes
ABC252 B Takahashi's Failure implementation C++17 · Notes
ABC253 A Median? implementation C++17 · Notes
ABC253 B Distance Between Tokens implementation, strings C++17 · Notes
ABC254 A Last Two Digits implementation, strings C++17 · Notes
ABC254 B Practical Computing implementation C++17 · Notes
ABC255 A You should output ARC, though this is ABC. implementation C++17 · Notes
ABC255 B Light It Up implementation C++17 · Notes
ABC256 A 2^N implementation C++17 · Notes
ABC256 B Batters implementation C++17 · Notes
ABC257 A A to Z String 2 implementation C++17 · Notes
ABC257 B 1D Pawn implementation C++17 · Notes
ABC258 A When? implementation C++17 · Notes
ABC258 B Number Box implementation, strings C++17 · Notes
ABC259 A Growth Record implementation C++17 · Notes
ABC259 B Counterclockwise Rotation implementation C++17 · Notes
ABC260 A A Unique Letter implementation, strings C++17 · Notes
ABC260 B Better Students Are Needed! implementation, sorting C++17 · Notes
ABC261 A Intersection implementation C++17 · Notes
ABC261 B Tournament Result implementation, strings C++17 · Notes
ABC262 A World Cup implementation C++17 · Notes
ABC262 B Triangle (Easier) implementation, matrices C++17 · Notes
ABC263 A Full House implementation, sorting C++17 · Notes
ABC263 B Ancestor implementation C++17 · Notes
ABC264 A "atcoder".substr() implementation, strings C++17 · Notes
ABC264 B Nice Grid implementation C++17 · Notes
ABC265 A Apple implementation C++17 · Notes
ABC265 B Explore implementation C++17 · Notes
ABC266 A Middle Letter implementation, strings C++17 · Notes
ABC266 B Modulo Number implementation C++17 · Notes
ABC267 A Saturday implementation, strings C++17 · Notes
ABC267 B Split? implementation, strings C++17 · Notes
ABC268 A Five Integers implementation, ordered containers C++17 · Notes
ABC268 B Prefix? implementation, strings C++17 · Notes
ABC269 A Anyway Takahashi implementation C++17 · Notes
ABC269 B Rectangle Detection implementation, strings C++17 · Notes
ABC270 A 1-2-4 Test implementation C++17 · Notes
ABC270 B Hammer implementation C++17 · Notes
ABC271 A 484558 implementation, strings C++17 · Notes
ABC271 B Maintain Multiple Sequences implementation, matrices C++17 · Notes
ABC272 A Integer Sum implementation C++17 · Notes
ABC272 B Everyone is Friends implementation, matrices C++17 · Notes
ABC273 A A Recursive Function implementation C++17 · Notes
ABC273 B Broken Rounding implementation C++17 · Notes
ABC274 A Batting Average implementation C++17 · Notes
ABC274 B Line Sensor implementation, strings C++17 · Notes
ABC275 A Find Takahashi implementation C++17 · Notes
ABC275 B ABC-DEF implementation C++17 · Notes
ABC276 A Rightmost implementation, strings C++17 · Notes
ABC276 B Adjacency List implementation, sorting, matrices C++17 · Notes
ABC277 A ^{-1} implementation C++17 · Notes
ABC277 B Playing Cards Validation implementation, strings, ordered containers C++17 · Notes
ABC278 A Shift implementation C++17 · Notes
ABC278 B Misjudge the Time implementation C++17 · Notes
ABC279 A wwwvvvvvv implementation, strings C++17 · Notes
ABC279 B LOOKUP implementation, strings C++17 · Notes
ABC280 A Pawn on a Grid implementation, strings C++17 · Notes
ABC280 B Inverse Prefix Sum implementation C++17 · Notes
ABC281 A Count Down implementation C++17 · Notes
ABC281 B Sandwich Number implementation, strings C++17 · Notes
ABC282 A Generalized ABC implementation C++17 · Notes
ABC282 B Let's Get a Perfect Score implementation, strings C++17 · Notes
ABC283 A Power implementation C++17 · Notes
ABC283 B First Query Problem implementation C++17 · Notes
ABC284 A Sequence of Strings implementation, strings C++17 · Notes
ABC284 B Multi Test Cases implementation C++17 · Notes
ABC285 A Edge Checker 2 implementation C++17 · Notes
ABC285 B Longest Uncommon Prefix implementation, strings C++17 · Notes
ABC286 A Range Swap implementation C++17 · Notes
ABC286 B Cat implementation, strings C++17 · Notes
ABC287 A Majority implementation, strings C++17 · Notes
ABC287 B Postal Card implementation, strings, ordered containers C++17 · Notes
ABC288 A Many A+B Problems implementation C++17 · Notes
ABC288 B Qualification Contest implementation, strings, sorting C++17 · Notes
ABC289 A flip implementation, strings C++17 · Notes
ABC289 B V implementation C++17 · Notes
ABC290 A Contest Result implementation C++17 · Notes
ABC290 B Qual B implementation, strings C++17 · Notes
ABC291 A camel Case implementation, strings C++17 · Notes
ABC291 B Trimmed Mean implementation, sorting C++17 · Notes
ABC292 A CAPS LOCK implementation, strings C++17 · Notes
ABC292 B Yellow and Red Card implementation C++17 · Notes
ABC293 A Swap Odd and Even implementation, strings C++17 · Notes
ABC293 B Call the ID Number implementation C++17 · Notes
ABC294 A Filter implementation C++17 · Notes
ABC294 B ASCII Art implementation C++17 · Notes
ABC295 A Probably English implementation, strings, ordered containers C++17 · Notes
ABC295 B Bombs implementation, strings C++17 · Notes
ABC296 A Alternately implementation, strings C++17 · Notes
ABC296 B Chessboard implementation, strings C++17 · Notes
ABC297 A Double Click implementation C++17 · Notes
ABC297 B chess960 implementation, strings C++17 · Notes
ABC298 A Job Interview implementation, strings C++17 · Notes
ABC298 B Coloring Matrix implementation, matrices C++17 · Notes
ABC299 A Treasure Chest implementation, strings C++17 · Notes
ABC299 B Trick Taking implementation C++17 · Notes
AtCoder Beginner Contest 300–399 · 142 solutions
ID Problem Technique Solution
ABC300 A N-choice question implementation C++17 · Notes
ABC300 B Same Map in the RPG World implementation, strings C++17 · Notes
ABC301 A Overall Winner implementation, strings C++17 · Notes
ABC301 B Fill the Gaps implementation C++17 · Notes
ABC302 A Attack implementation C++17 · Notes
ABC302 B Find snuke implementation, strings C++17 · Notes
ABC303 A Similar String implementation, strings C++17 · Notes
ABC303 B Discord implementation, matrices C++17 · Notes
ABC304 A First Player implementation, strings C++17 · Notes
ABC304 B Subscribers implementation, strings C++17 · Notes
ABC305 A Water Station implementation C++17 · Notes
ABC305 B ABCDEFG implementation C++17 · Notes
ABC306 A Echo implementation, strings C++17 · Notes
ABC306 B Base 2 implementation C++17 · Notes
ABC307 A Weekly Records implementation C++17 · Notes
ABC307 B racecar implementation, strings C++17 · Notes
ABC308 A New Scheme implementation C++17 · Notes
ABC308 B Default Price implementation, strings, ordered containers C++17 · Notes
ABC309 A Nine implementation C++17 · Notes
ABC309 B Rotate implementation, strings C++17 · Notes
ABC310 A Order Something Else implementation C++17 · Notes
ABC310 B Strictly Superior implementation, matrices C++17 · Notes
ABC311 A First ABC implementation, strings C++17 · Notes
ABC311 B Vacation Together implementation, strings C++17 · Notes
ABC312 A Chord implementation, strings, ordered containers C++17 · Notes
ABC312 B TaK Code implementation, strings C++17 · Notes
ABC313 A To Be Saikyo implementation C++17 · Notes
ABC313 B Who is Saikyo? implementation C++17 · Notes
ABC314 A 3.14 implementation, strings C++17 · Notes
ABC314 B Roulette implementation, matrices C++17 · Notes
ABC315 A tcdr implementation, strings C++17 · Notes
ABC315 B The Middle Day implementation C++17 · Notes
ABC317 A Potions implementation C++17 · Notes
ABC317 B MissingNo. implementation, sorting C++17 · Notes
ABC318 A Full Moon implementation C++17 · Notes
ABC318 B Overlapping sheets implementation, matrices C++17 · Notes
ABC319 A Legendary Players implementation, strings, ordered containers C++17 · Notes
ABC319 B Measure implementation C++17 · Notes
ABC320 A Leyland Number implementation C++17 · Notes
ABC320 B Longest Palindrome implementation, strings C++17 · Notes
ABC321 A 321-like Checker implementation, strings C++17 · Notes
ABC321 B Cutoff implementation C++17 · Notes
ABC322 A First ABC 2 implementation, strings C++17 · Notes
ABC322 B Prefix and Suffix implementation, strings C++17 · Notes
ABC323 A Weak Beats implementation, strings C++17 · Notes
ABC323 B Round-Robin Tournament implementation, strings, sorting C++17 · Notes
ABC324 A Same implementation C++17 · Notes
ABC324 B 3-smooth Numbers implementation C++17 · Notes
ABC325 A Takahashi san implementation, strings C++17 · Notes
ABC325 B World Meeting implementation C++17 · Notes
ABC326 A 2UP3DOWN implementation C++17 · Notes
ABC326 B 326-like Numbers implementation C++17 · Notes
ABC327 A ab implementation, strings C++17 · Notes
ABC327 B A^A implementation C++17 · Notes
ABC328 A Not Too Hard implementation C++17 · Notes
ABC328 B 11/11 implementation, strings C++17 · Notes
ABC329 A Spread implementation, strings C++17 · Notes
ABC329 B Next implementation, ordered containers C++17 · Notes
ABC330 A Counting Passes implementation C++17 · Notes
ABC330 B Minimize Abs 1 implementation C++17 · Notes
ABC331 A Tomorrow implementation C++17 · Notes
ABC331 B Buy One Carton of Milk implementation C++17 · Notes
ABC332 A Online Shopping implementation C++17 · Notes
ABC332 B Glass and Mug implementation C++17 · Notes
ABC333 A Three Threes implementation, strings C++17 · Notes
ABC333 B Pentagon implementation, strings C++17 · Notes
ABC334 A Christmas Present implementation C++17 · Notes
ABC334 B Christmas Trees implementation C++17 · Notes
ABC335 A 202<s>3</s> implementation, strings C++17 · Notes
ABC335 B Tetrahedral Number implementation C++17 · Notes
ABC336 A Long Loong implementation, strings C++17 · Notes
ABC336 B CTZ implementation C++17 · Notes
ABC337 A Scoreboard implementation C++17 · Notes
ABC337 B Extended ABC implementation, strings C++17 · Notes
ABC338 A Capitalized? implementation, strings C++17 · Notes
ABC338 B Frequency implementation, strings C++17 · Notes
ABC339 A TLD implementation, strings C++17 · Notes
ABC339 B Langton's Takahashi implementation, strings C++17 · Notes
ABC340 A Arithmetic Progression implementation C++17 · Notes
ABC340 B Append implementation C++17 · Notes
ABC341 A Print 341 implementation C++17 · Notes
ABC341 B Foreign Exchange implementation C++17 · Notes
ABC342 A Yay! implementation, strings C++17 · Notes
ABC342 B Which is ahead? implementation C++17 · Notes
ABC343 A Wrong Answer implementation C++17 · Notes
ABC343 B Adjacency Matrix implementation C++17 · Notes
ABC344 A Spoiler implementation, strings C++17 · Notes
ABC344 B Delimiter implementation C++17 · Notes
ABC345 A Leftrightarrow implementation, strings C++17 · Notes
ABC345 B Integer Division Returns implementation C++17 · Notes
ABC346 A Adjacent Product implementation C++17 · Notes
ABC346 B Piano implementation, strings C++17 · Notes
ABC347 A Divisible implementation C++17 · Notes
ABC347 B Substring implementation, strings, ordered containers C++17 · Notes
ABC348 A Penalty Kick implementation C++17 · Notes
ABC348 B Farthest Point implementation C++17 · Notes
ABC349 A Zero Sum Game implementation C++17 · Notes
ABC349 B Commencement implementation, strings C++17 · Notes
ABC350 A Past ABCs implementation, strings C++17 · Notes
ABC350 B Dentist Aoki implementation C++17 · Notes
ABC351 A The bottom of the ninth implementation C++17 · Notes
ABC351 B Spot the Difference implementation, strings C++17 · Notes
ABC352 A AtCoder Line implementation C++17 · Notes
ABC352 B Typing implementation, strings C++17 · Notes
ABC353 A Buildings implementation C++17 · Notes
ABC353 B AtCoder Amusement Park implementation C++17 · Notes
ABC354 A Exponential Plant implementation C++17 · Notes
ABC354 B AtCoder Janken 2 implementation, strings, sorting C++17 · Notes
ABC355 A Who Ate the Cake? implementation C++17 · Notes
ABC355 B Piano 2 implementation, sorting C++17 · Notes
ABC356 A Subsegment Reverse implementation C++17 · Notes
ABC356 B Nutrients implementation C++17 · Notes
ABC357 A Sanitize Hands implementation C++17 · Notes
ABC357 B Uppercase and Lowercase implementation, strings C++17 · Notes
ABC358 A Welcome to AtCoder Land implementation, strings C++17 · Notes
ABC358 B Ticket Counter implementation C++17 · Notes
ABC359 A Count Takahashi implementation, strings C++17 · Notes
ABC359 B Couples implementation C++17 · Notes
ABC360 A A Healthy Breakfast implementation, strings C++17 · Notes
ABC360 B Vertical Reading implementation, strings C++17 · Notes
ABC361 A Insert implementation C++17 · Notes
ABC361 B Intersection of Cuboids implementation C++17 · Notes
ABC362 A Buy a Pen implementation, strings C++17 · Notes
ABC362 B Right Triangle implementation, sorting C++17 · Notes
ABC363 A Piling Up implementation C++17 · Notes
ABC363 B Japanese Cursed Doll implementation, sorting C++17 · Notes
ABC364 A Glutton Takahashi implementation, strings C++17 · Notes
ABC364 B Grid Walk implementation, strings C++17 · Notes
ABC365 A Leap Year implementation C++17 · Notes
ABC365 B Second Best implementation, sorting C++17 · Notes
ABC366 A Election 2 implementation C++17 · Notes
ABC366 B Vertical Writing implementation, strings C++17 · Notes
ABC367 A Shout Everyday implementation C++17 · Notes
ABC367 B Cut .0 implementation, strings C++17 · Notes
ABC368 A Cut implementation C++17 · Notes
ABC368 B Decrease 2 max elements implementation, heaps C++17 · Notes
ABC369 A 369 implementation C++17 · Notes
ABC369 B Piano 3 implementation C++17 · Notes
ABC370 A Raise Both Hands implementation C++17 · Notes
ABC370 B Binary Alchemy implementation, matrices C++17 · Notes
ABC372 A delete . implementation, strings C++17 · Notes
ABC373 A September implementation, strings C++17 · Notes

Algorithms and C++

Resource Contents
Algorithm library Reusable data structures and string algorithms with property checks
C++ field notes Types, references, STL, overflow, and indexing
Practice route A staged path from basic C++ to timed problem sets
Contest journal Attempts, mistakes, results, and upsolving

Run locally

Requires Python 3.10+ and a C++17 compiler. No Python packages are needed.

# Browse the archive.
python3 tools/cp.py list

# Create a practice file and test your own solution.
python3 tools/cp.py practice cses-1083
python3 tools/cp.py test cses-1083 --source practice/cses-1083.cpp

# Get a hint when needed.
python3 tools/cp.py hint cses-1083

Open the problem, write your solution, test it, and submit it on the judge. Read the reference implementation after your attempt. Files in practice/ stay local until you deliberately archive them.

Every file in solutions/ is standalone C++17; no local headers are needed for submission. Set CXX=clang++ or CXX=g++ to choose a compiler. On macOS, install Apple's command-line tools with xcode-select --install. The sources use standard headers.

Verification

The archive has 2,964 fixed test cases, 10,100 seeded randomized cases across 101 solutions, and 31 constraint-limit checks. GitHub Actions runs four shards on both Linux/GCC and macOS/Clang. See the verification record for results, scope, and reproducible commands.

Run the verification suite

Run these commands one at a time:

python3 tools/cp.py check
python3 tools/cp.py test all --jobs 4
python3 tools/cp.py test all --sanitize --jobs 4
python3 tools/cp.py stress --cases 100 --seed 2110
python3 tools/boundary.py
python3 -m unittest discover -s tests -p 'test_*.py' -v

Builds treat warnings as errors. The sanitizer checks undefined behavior; randomized suites compare against independent small-input models and structural checks. In VS Code, use Tasks: Run Test Task.

About this archive

Maintained by Michael Baffour Awuah for learning algorithms and practicing C++ under contest constraints.

The counts describe implementations in the collection. The verification record covers local tests; progress records official submission evidence separately.

Keep one meaningful change per commit: a solution and explanation, a regression fix, or a reusable technique. Add a test for the mistake that taught you something, and keep the submission URL when recording an acceptance.

Archive organization inspired by thecodingwizard/competitive-programming. Problem statements remain on their original platforms.

About

800+ C++ solutions I have solved for various competitions CSES, Codeforces, and AtCoder, with algorithm notes, tests, and reusable data structures.

Resources

Contributing

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages