BZOJ 1022: [SHOI2008]小约翰的游戏John
二次联通门 : BZOJ 1022: [SHOI2008]小约翰的游戏John
/* BZOJ 1022: [SHOI2008]小约翰的游戏John 博弈论 lqz 这种zz怎么可能会博弈呢? */ #include <cstdio> #include <iostream> #define rg register inline void read (int &n) { rg char c = getchar (); for (n = 0; !isdigit (c); c = getchar ()); for (; isdigit (c); n = n * 10 + c - '0', c = getchar ()); } int main (int argc, char *argv[]) { int T, N, x, sg; bool f; rg int i; read (T); for (; T; -- T) { read (N); f = false, sg = 0; for (i = 1; i <= N; ++ i) { read (x); if (x != 1) f = true; sg ^= x; } if ((!f && !sg) || (sg && f)) puts ("John"); else puts ("Brother"); } return 0; }
myj 吊打我Orz,xxy 捆起来打我Orz,myl 文化课上天Orz, lrh 姿势水平敲高Orz, hkd 特别胖Orz%%%,cys 智商感人Orz,syl zz专业Orz,我没有学上, 我们未来一片光明