Why it is giving me wrong answer on submission of XORAGN? When i use, cin, then i get AC, is the read function in my code slow?

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