题解:P13683 【MX-X16-T1】「DLESS-3」XOR and Greater Sum
chenshixian · · 题解
洛谷P13683
题意
给定t组数据,每一个数据包含:
一个整数
要求出是否可以选出一些数,使他们的异或和
思路
我们可以设
如果
如果
所以,如果这个序列全部异或为
AC代码
#include<bits/stdc++.h>
using namespace std;
int main(){
int t;
cin>>t;
while(t--){
int n;
cin>>n;
int to=0;
for(int i=0;i<n;i++){
int x;
cin>>x;
to^=x;
}
if(to!=0)cout<<"Yes\n";
else cout<<"No\n";
}
return 0;
}