Sonesh in GadgetLand
CodeChefOpen on judge ↗
GadgetLand is famous for gadgets(obviously) and magic. It has N shops and each has magic power. Power of ith shop is given by a single integer Pi. Initially there are M bidirectional roads in GadgetLand between shops. A "Batch" is set of all the shops in which each shop can be reached by every other shop of the set. Batch Power of a batch is defined as xor sum of power of all the shops in the bat
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start