Getting wrong ans

https://codeforces.com/problemset/problem/467/B

my code failing in 2nd test case please tell me what is the flaw in my code

If the bitset that you’re creating is of size 32(which you can lower to 21 because the constraint of the problems is less), then in line number 30 you need to run the loop just 31 times.
I’ve made changes in your code you can check it here.
However, there’s an efficient way of solving the problem, that is counting the number of set bits(by just iterating on the set bits) in a[m] and a[i], 0<=i<=m-1.
You can check out my code here.