标签:
Description
Input
Output
Sample Input
Sample Output
Source
依旧是anti-nim
AC记录喜+1
1 /*by SilverN*/ 2 #include<iostream> 3 #include<algorithm> 4 #include<cstring> 5 #include<cstdio> 6 #include<cmath> 7 using namespace std; 8 int n; 9 int s; 10 int main(){ 11 int T; 12 scanf("%d",&T); 13 while(T--){ 14 scanf("%d",&n); 15 bool flag=0; 16 s=0; 17 int i,j; 18 int a; 19 for(i=1;i<=n;i++){ 20 scanf("%d",&a); 21 s^=a; 22 if(a>1)flag=1; 23 } 24 if(flag){ 25 if(s==0)printf("Brother\n"); 26 else printf("John\n"); 27 } 28 else 29 if(n&1)printf("Brother\n"); 30 else printf("John\n"); 31 32 } 33 return 0; 34 }
标签:
原文地址:http://www.cnblogs.com/SilverNebula/p/5658704.html