Magical Flips
Chef found $N$ magical cards in his drawer. Each card has a number written on each of its faces. He places all the cards on the table in a front face-up manner. Chef denotes the numbers on the front face by $A_1, A_2,..., A_N$ and on the back face by $B_1, B_2,..., B_N$. Chef can choose some (possibly zero or all) cards and flip them, then he will calculate the [bitwise AND](https://en.wikipedia.
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