Distinguish multi-qubit basis states

Problem Name:
Distinguish multi-qubit basis states
Site:CodeForces
Links:
Tags:
Problem setters: