← All problemsSign in

GOOD BAD

There are $2^N$ students in a college. Each student has an unknown good value and bad value associated to him/her. But there is a way to find the good value and bad value of each student. For each $0$Σ arr[$j$]*$j$ for all 0 For each $0$Σ arr[$j$]*$j$ for all 0 where & is bitwise AND operator, | is bitwise OR operator and arr[$j$] is the ability of student $j$. You will be given $Q$ queries. Ea

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start