ZOJ 3113 Anti-SG
来源:互联网 发布:淘宝店导航装修视频 编辑:程序博客网 时间:2024/06/06 21:56
与ZOJ 2507一样
#include <set>#include <cmath>#include <queue>#include <stack>#include <string>#include <cstdio>#include <cstring>#include <algorithm>using namespace std;typedef long long LL;const double PI = acos(-1.0);template <class T> inline T MAX(T a, T b){if (a > b) return a;return b;}template <class T> inline T MIN(T a, T b){if (a < b) return a;return b;}const int N = 111;const int M = 11111;const LL MOD = 1000000007LL;const int dir[4][2] = {1, 0, -1, 0, 0, -1, 0, 1};const int INF = 0x3f3f3f3f;int main(){ int T; scanf("%d", &T); while (T--) { int temp = 0, n, ans, a; ans = 0; scanf("%d", &n); for (int i = 0; i < n; ++i) { scanf("%d", &a); if (a >= 2) { temp = 1; } ans ^= a; } if ((ans == 0 && temp == 0) || ((ans != 0) && (temp == 1))) printf("John\n"); else printf("Brother\n"); } return 0;}
- ZOJ 3113 Anti-SG
- ZOJ 2507 Anti-SG
- ZOJ 2507 ANTI-SG博弈
- poj3480(Anti-SG 游戏)
- HDU 1907 John (ANTI-SG)
- nim misere game anti-sg
- BZOJ 1022 Anti-SG游戏
- HDU-1907 John (Anti-SG)
- poj 3480 John anti-SG博弈
- [BZOJ1022]SHOI2008 JONH|anti-Nim|SG函数
- 用SJ定理解决Anti-SG游戏
- HDU 2509 Be the Winner Anti-SG
- Anti-SG游戏 与 SJ定理笔记
- zoj 3529 博弈SG
- ZOJ 2083 SG博弈
- ZOJ 2083 SG函数
- ZOJ 3084 SG函数
- ZOJ 2725 SG函数 DP
- Struts 常用验证
- div页面垂直居中方法
- 关于二叉树的相关操作汇总
- Excel VBA以单元格区域做参数
- 00
- ZOJ 3113 Anti-SG
- iOS应用程序生命周期(前后台切换,应用的各种状态)详解
- hdu——2815(数论之Baby Step Giant Step解决离散对数问题)
- ios生命周期
- iPhone开发音频资料
- LinkedHashMap和HashMap的比较使用
- [每日一题] OCP1z0-047 :2013-08-16 merge的用法....................................................45
- IOS自定义状态栏代码解析
- Linux系统下修改文档及文件夹(含子文件夹)权限