getting WA in KMXOR

My code link: https://www.codechef.com/viewsolution/18622440
Every case seems to give correct answer. Please help!!
Question link: https://www.codechef.com/COOK94B/problems/KMXOR

try this test case and do let me know if there wasn’t any mistake…

1 Like

My output is:
1 1 1 1
1 1 1 1 1
2 1 1 1 1
2 1 1 1 1 1
3 3 3 3 3
3 3 2 1 1 1
8 6 1 1 1
8 7
8 7 7 7
and there seems no mistake!!

Please reply, there wasn,t any mistake…

let me check your code…

1
1 3
gives output 33… which is wrong… check in your code…

if(ans == 0 && n!=1)
add n!=1 like this and your code is ready for AC… :smiley:

thanks a lot bro!!
Really tough to find such type of mistakes in a huge code

1 Like

welcome :slight_smile: