Day12.2(组合、期望、博弈论)
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"); } }

浙公网安备 33010602011771号