AFZQ2019 CHOCOS failing testcase

Shouldn’t this accepted code fail CodeChef: Practical coding for everyone , for this input?
3 3 1
001
Expected answer should be 2 as you can select all indexes and take their XOR with 1 to get 110.
But this solution gives 1 as answer.