I was solving a question on codeforces. I tried using
__builtin_popcount(x) to count the number of active bits, but that method gave a WA. When I just changed
__builtin_popcount(x) to loop counter, it gave AC.
Do you know why was there this behavior?
Please note that I was doing exor, so I don’t think overflow would be the reason (personal opinion)
A diff checker Link to compare two codes. (Left one is WA and the right one is AC)