Nim和什么鬼。。求教博弈论Orz
![](https://i-blog.csdnimg.cn/blog_migrate/8f900a89c6347c561fdf2122f13be562.gif)
![](https://i-blog.csdnimg.cn/blog_migrate/961ddebeb323a10fe0623af514929fc1.gif)
1 #include <iostream> 2 #include <algorithm> 3 #include <cstring> 4 #include <cstdlib> 5 #include <map> 6 #include <string> 7 #include <vector> 8 #include <stack> 9 #include <cmath> 10 #include <queue> 11 #include <cstdio> 12 #include <set> 13 using namespace std; 14 15 16 int T,x,f,n,s; 17 int main(){ 18 scanf("%d",&T); 19 while(T--){ 20 scanf("%d",&n); 21 for(int i=1;i<=n;i++)scanf("%d",&x),s^=x,f|=x!=1; 22 printf("%s\n",!!s==f?"John":"Brother"),s=f=0; 23 } 24 }