标签:href c++ its hdu john stdin div style freopen
http://acm.hdu.edu.cn/showproblem.php?pid=1907
后取完的输
#include <bits/stdc++.h> using namespace std; int t,n,x,tmp,g; int main(){ //freopen("in","r",stdin); ios::sync_with_stdio(0); cin >> t; while(t--) { tmp = 0; g = 0; cin >> n; for (int i = 1; i <= n; i++) { cin >> x; if(x == 1) g++; tmp ^= x; } if(g != n) { if (tmp) cout << "John" << endl; else cout << "Brother" << endl; }else{ if(g & 1) cout << "Brother" << endl; else cout << "John" << endl; } } return 0; }
标签:href c++ its hdu john stdin div style freopen
原文地址:https://www.cnblogs.com/xcfxcf/p/12570261.html