详解:hdu 1907 John - lihaogegehuting的专栏 - 博客频道 - CSDN.NET
两道题几乎一样
代码如下:
#include<stdio.h> int main() { int T,a[100],i,sum,ok; while(~scanf("%d",&T)) { sum=0; ok=0; for(i=1;i<=T;i++) { scanf("%d",&a[i]); if(a[i]>1) ok=1; sum=sum^a[i]; } if(ok==0) { if(T%2==0) printf("Yes\n"); else printf("No\n"); } else if(sum==0) printf("No\n"); else printf("Yes\n"); } return 0; }
hdu 2509 Be the Winner,布布扣,bubuko.com
原文地址:http://blog.csdn.net/lihaogegehuting/article/details/38231633