hdu2509

时间:2014-04-27 23:08:07   收藏:0   阅读:625
bubuko.com,布布扣
 1 //Accepted 0MS 232K
 2 #include <cstdio>
 3 #include <cstring>
 4 int ans;
 5 int t;
 6 int n;
 7 void slove()
 8 {
 9     int x;
10     ans=0;
11     t=0;
12     for (int i=0;i<n;i++)
13     {
14         scanf("%d",&x);
15         ans=ans^x;
16         if (x>1) t++;
17     }
18     if ((ans==0 && t>=2) || (ans!=0 && t==0))
19     {
20         printf("No\n");
21     }
22     else
23     {
24         printf("Yes\n");
25     }
26 }
27 int main()
28 {
29     while (scanf("%d",&n)!=EOF)
30     {
31         slove();
32     }
33     return 0;
34 }
bubuko.com,布布扣

 

hdu2509,布布扣,bubuko.com

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!