ENGXOR wrong answer

The following code is giving me WA but I can’t seem to figure out why. Need help.

https://www.codechef.com/viewsolution/30594957

Thanks in advance.

Why is the return 0 inside the while loop?. Also you need to use __builtin_parity() to find it faster. modulo operation are too slow.

Thanks! I totally looked over the return statement. I tried doing with the __builtin_parity()but it still gives me WA

solution link?

Here:
https://www.codechef.com/viewsolution/30687046

Thanks in advance.

Do not use %2. modulo operations are slow. Use __builtin_parity()

Did:
https://www.codechef.com/viewsolution/30687080

Uncommenting cin.tie(); gave AC.
https://www.codechef.com/viewsolution/30687197

2 Likes

I believe cin.tie() makes the output to be produced all at once. But in the original question, it asked to print output after each query. So how did it went wrong. Please correct me if I’m wrong.

The question is not interactive, that means you can answer them whenever.

1 Like