p2148 [SDOI2009]E&D
分析
https://www.luogu.org/blog/flashblog/solution-p2148
代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int t,n,i,x,y,Ans,cnt;
scanf("%d",&t);
while(t--){
scanf("%d",&n);
n/=2;
Ans=0;
for(i=1;i<=n;i++){
scanf("%d%d",&x,&y);
cnt=0;
x=(x-1)|(y-1);
while(x&1)cnt++,x>>=1;
Ans^=cnt;
}
if(Ans)puts("YES");
else puts("NO");
}
return 0;
}