Save The City
CodeChefOpen on judge ↗
A Russian spy has planted a series of bombs in a city in the following positions: A1, A2, …, AN. Your mission as detective Ethan Hunt is to find a pair of integers Au, Av (1 ≤ u v ≤ N) such that (Au and Av) is as large as possible, since he has been tipped that the bombs in these positions will explode first. AND is a bit-wise operation which is corresponding to & in C++ and Java. Input - Th
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