标签:
Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 3058 Accepted Submission(s): 2261
1 /************************************************************************* 2 > File Name: code/hdu/1849.cpp 3 > Author: 111qqz 4 > Email: rkz2013@126.com 5 > Created Time: 2015年09月22日 星期二 20时37分46秒 6 ************************************************************************/ 7 8 #include<iostream> 9 #include<iomanip> 10 #include<cstdio> 11 #include<algorithm> 12 #include<cmath> 13 #include<cstring> 14 #include<string> 15 #include<map> 16 #include<set> 17 #include<queue> 18 #include<vector> 19 #include<stack> 20 #include<cctype> 21 #define y1 hust111qqz 22 #define yn hez111qqz 23 #define j1 cute111qqz 24 #define ms(a,x) memset(a,x,sizeof(a)) 25 #define lr dying111qqz 26 using namespace std; 27 #define For(i, n) for (int i=0;i<int(n);++i) 28 typedef long long LL; 29 typedef double DB; 30 const int inf = 0x3f3f3f3f; 31 int m; 32 int main() 33 { 34 #ifndef ONLINE_JUDGE 35 freopen("in.txt","r",stdin); 36 #endif 37 while (scanf("%d",&m)!=EOF&&m) 38 { 39 int sum = 0 ; 40 for ( int i = 0 ;i < m ; i++) 41 { 42 int x; 43 scanf("%d",&x); 44 sum ^= x; 45 } 46 //cout<<sum<<endl; 47 if (sum) 48 { 49 puts("Rabbit Win!"); 50 } 51 else 52 { 53 puts("Grass Win!"); 54 } 55 } 56 57 #ifndef ONLINE_JUDGE 58 fclose(stdin); 59 #endif 60 return 0; 61 }
hdu 1849Rabbit and Grass(博弈论 一维nim游戏)
标签:
原文地址:http://www.cnblogs.com/111qqz/p/4830445.html