hdu 2176+hdu 2147

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2147

直接猜的。。。

View Code
 1 #include<iostream>
 2 using namespace std;
 3 
 4 int main(){
 5     int n,m;
 6     while(~scanf("%d%d",&n,&m)&&n&&m){
 7         if(n%2&&m%2){
 8             printf("What a pity!\n");
 9         }else 
10             printf("Wonderful!\n");
11     }
12     return 0;
13 }

 

题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2176

尼姆博弈。

View Code
 1 #include<iostream>
 2 const int N=200004;
 3 using namespace std;
 4 int num[N];
 5 
 6 int main(){
 7     int m;
 8     while(~scanf("%d",&m)&&m){
 9         int s=0;
10         for(int i=0;i<m;i++){
11             scanf("%d",&num[i]);
12             s^=num[i];
13         }
14         if(!s){
15             printf("No\n");
16         }else {
17             printf("Yes\n");
18             for(int i=0;i<m;i++){
19                 int k=s^num[i];
20                 if(k<num[i]){
21                     printf("%d %d\n",num[i],k);
22                 }
23             }
24         }
25     }
26     return 0;
27 }

 

 

 

posted @ 2013-03-22 17:57  ihge2k  阅读(200)  评论(0编辑  收藏  举报