Codechef marked said this is wrong answer but when i tested on eclipse and other online compilers this code is giving correct output.
What’s the problem?
#include <iostream>
using namespace std;
int main() {
int t;
cin>>t;
while(t--){
int n,cnt;
cnt=0;
cin>>n;
bool s[n],r[n];
for(int i=0 ; i<n ; i++)
cin>>s[i];
for(int i=0 ; i<n ; i++)
cin>>r[i];
for(int i=0 ; i<n ; i++){
if(s[i] != r[i])
cnt++;
}
(cnt%2 == 0) ? cout<<1<<endl : cout<<0<<endl;
}
return 0;
}