多堆的情况要处理好孤单堆
1 #include<cstdio> 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cmath> 6 #include<queue> 7 #include<map> 8 using namespace std; 9 #define MOD 1000000007 10 const int INF=0x3f3f3f3f; 11 const double eps=1e-5; 12 typedef long long ll; 13 #define cl(a) memset(a,0,sizeof(a)) 14 #define ts printf("*****\n"); 15 const int MAXN=1005; 16 int n,m,tt; 17 int main() 18 { 19 int i,j,k,ca=1; 20 #ifndef ONLINE_JUDGE 21 freopen("1.in","r",stdin); 22 #endif 23 while(scanf("%d",&n)!=EOF) 24 { 25 int temp=0; 26 int a; 27 int ans; 28 for(i=0;i<n;i++) 29 { 30 scanf("%d",&a); 31 if(i==0) 32 { 33 ans=a; 34 } 35 else ans^=a; 36 } 37 if(ans==0) 38 printf("No\n"); 39 else 40 printf("Yes\n"); 41 } 42 }
时间: 2024-10-27 14:19:35