Practice problems where the whole solution is an observation. Each row names the observation, so solve first and read the hint only when stuck. The list grows over time; add a row whenever an upsolved problem had a reusable idea.
| Problem | Key observation | Note |
|---|---|---|
| CSES 1083 Missing Number | sum of minus the given sum (or xor) | Toolkit |
| CSES 1069 Repetitions | one scan over runs | Arrays and Strings |
| CSES 1094 Increasing Array | cost is | Ordering |
| CSES 1070 Permutations | evens then odds works for ; impossible | Permutation Constructions |
| CSES 1071 Number Spiral | the layer is ; its parity fixes the direction | Toolkit |
| CSES 1072 Two Knights | all pairs minus attacking pairs | Complementary Counting |
| CSES 1092 Two Sets | possible iff is even; fill greedily from down | Small Answers |
| CSES 1754 Coin Piles | and | Invariants |
| CSES 1755 Palindrome Reorder | at most one odd count; build half and mirror | Arrays and Strings |
| CSES 1618 Trailing Zeros | count factors of 5: | Factorials |
| CSES 2205 Gray Code | Gray Code | |
| CSES 2165 Tower of Hanoi | recursive structure, moves | Tower of Hanoi |
| POJ 1852 Ants | collisions = passing through | Ordering |
| Codeforces 1525B Permutation Sort | answer in by the ends | Small Answers |
| Codeforces 1696B NIT Destroys the Universe | answer in by the nonzero block | Small Answers |
| Codeforces 1437B Reverse Binary Strings | Arrays and Strings | |
| 15-puzzle solvability (classic) | inversion parity plus the blank’s row | Invariants |
| Mutilated chessboard (classic) | colouring | Invariants |
Proof: Two Sets and Coin Piles conditions
Two Sets. Equal halves need an even total . Conversely, let the target be and take numbers greedily from downward while they fit: each taken number is at most the remaining target, and once the remaining target is smaller than the next number , it is at most , so it is itself one of the untaken numbers . Take it and stop. Coin Piles. Each move removes 3 coins in total, so , and each move takes at most 2 coins from any pile, so , which is equivalent to . Conversely, with moves of type and of type , solve , : , , which are non-negative integers exactly under the two conditions.
Related: How to Practice.