##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
##### ###### ##### ### # # ### # # ###### ## ## ## ## ## ## ## # # # # # ## ##### #### ##### # # # # # # # #### ## # ## ## ## ## # # # # # ## ## # ###### ## ### # ### # ######
Parity arguments, invariants, greedy constructions, and reverse simulation through 10 problems.
Building valid solutions from constraints
What you'll learn
CF 1375D - transform array using MEX operations
Random operations don't converge
Fix positions using MEX cycles
Greedy MEX placement
Quadratic in array size
CF 1450C1 - modify grid to avoid wins
Change one color class
Color class transformation
Linear in grid size
CF 1485D - construct grid with divisibility
LCM checkerboard
LCM-based checkerboard
Linear construction
CF 1559D1 - add edges to two forests simultaneously
Greedy with dual DSU
Dual DSU edge selection
Quadratic pair iteration
CF 1605D - label tree to control XOR traversal
Exponential labelings
Group numbers by highest bit
Bipartite coloring by bit groups
Bipartite assignment by bit
Linear tree traversal
CF 1572B - make array all zeros with XOR operations
Search space is huge
Parity and greedy zeroing
Check invariant and construct
Linear construction
CF 1638D - reconstruct painting sequence
Forward simulation has too many choices
Reverse greedy with queue
BFS-style reverse simulation
Linear in grid size
Test your understanding
What you've learned