WA in XORSPRT

Why does this code produce WA in some tests? I’m pretty convinced this DP should work or I misinterpreted the problem. Here’s the link to submission Solution: 49339812 | CodeChef

Thanks.

you need to increase your loop of k from 64 to 2500. Or if you want to avoid overflow, check for special case of xor = 0.

2 Likes

Oh, now I see, my bad. Thanks.