标签:pac put one sample [1] size long time ons
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 980 Accepted Submission(s): 573
#include<bits/stdc++.h> #define N 45000 #define mes(x) memset(x, 0, sizeof(x)); #define ll __int64 const long long mod = 1e9+7; const int MAX = 0x7ffffff; using namespace std; int dir[200], SG[200]; int getSG(int n){ if(n == 0) return 0; if(n%8 == 0) return n-1; if(n%8 == 7) return n+1;//注意这里是n%8==7,不是n%7==0.... return n; } int main() { int T,t, i,n, ans; scanf("%d", &T); while(T--){ scanf("%d", &n); for(ans=i=0;i<n;i++){ scanf("%d", &t); ans ^= getSG(t); } if(ans==0) printf("Second player wins.\n"); else printf("First player wins.\n"); } return 0; }
标签:pac put one sample [1] size long time ons
原文地址:http://www.cnblogs.com/Noevon/p/6241226.html