Help with explanation

prob: https://atcoder.jp/contests/abc068/tasks/abc068_b

editorial: https://img.atcoder.jp/arc079/editorial.pdf

my_code: https://ide.codingblocks.com/s/438250

my code is not working for few test cases (input = 32) also please explain how they have used bitwise operator in the editorial I have forgotten them.

hello @raghav007
u simply have to find the largest power of 2 that is less than equal to N becuase then only u will be able to divide it maximum times.

for that u can u can simply run while loop

s=1;
while(s*2<=N) {
   s=s*2;  // or use s=s<<1 ;  both are same
}

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.