https://vjudge.net/problem/AtCoder-2064
https://vjudge.net/problem/51Nod-1237
http://acm.hdu.edu.cn/showproblem.php?pid=3590 //讲的是错的!!
https://www.lydsy.com/JudgeOnline/problem.php?id=1022
取石子,反Nim游戏
#include<bits/stdc++.h>
using namespace std;
int main(){
int T;
scanf("%d",&
T);
while(T--
){
int n;scanf(
"%d",&
n);
int ans,x,flag=
0;scanf(
"%d",&ans);
if(ans>
1) flag=
1;
while(--n) {scanf(
"%d",&x),ans^=x;
if(x>
1) flag=
1;}
if((flag>
0&&!ans)||(flag==
0&&ans)) printf(
"Brother\n");
else printf(
"John\n");
}
}
Bzoj1022
转载于:https://www.cnblogs.com/wifimonster/p/10260681.html