标签:return std ace lan show temp names include php
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2509
题意:有N堆,谁最后拿谁输。
关键:判断孤单堆。
1 #include<cstdio> 2 #define ll long long 3 using namespace std; 4 5 int main() 6 { 7 int n; 8 while( ~scanf("%d",&n)){ 9 int temp,ans=0,flag=0; 10 for(int i=1;i<=n;i++){ 11 scanf("%d",&temp); 12 ans^=temp; 13 if(temp>1) flag=1; 14 } 15 if(!flag){ 16 if(n&1) printf("No\n"); 17 else printf("Yes\n"); 18 } 19 else{ 20 if(ans) printf("Yes\n"); 21 else printf("No\n"); 22 } 23 } 24 return 0; 25 }
标签:return std ace lan show temp names include php
原文地址:https://www.cnblogs.com/ZQUACM-875180305/p/9326813.html