π WAYPOINT LESSON
Checkpoint β The Small-n Law
βββ advancedβ³ 20 min readπ Lesson 255 of 281
n β€ 20: resist overengineering. The 2^n enumeration is the intended solution; the plausible greedy is the trap.
Δiα»m kiα»m tra β Δα»nh luαΊt n nhα». Given n β€ 20 non-negative integers, print the maximum possible XOR of any non-empty subset. The arithmetic says 2^20 β 10^6 β brute force fits with huge margin. The greedy "take it if the XOR improves" is a well-known wrong answer: verify against the sample where it fails.