Didn’t work with that too. Still AC on 1&2 subtask and WA on 3rd
Suffering from floating errors. If you use “K>>=1” and “N!>>=1” instead of dividing K by 2, you will get AC. Still looking why your K behaves weirdly, but I am no python user
EDIT: Refer to “//” and “/” operator, and their difference.
Floating point divison has an error of about {10}^{-9} ,and that matters a LOT here
2 Likes
Got another reason to hate python c++ is my regular one.
Thanks Vijju123 Got AC
0246|1357. See 1 = 0+1, 3 = 2+1 and so on. Similar for other iterations. See the ‘|’ in editorial to indicate blocks.
overflow issues…didn’t you check 2nd sample case given ??
That’s reversing the binary representation. And you would usually use << operator to get a power of 2.