hdu1907John 简单博弈
来源:互联网 发布:三菱编程软件的安装 编辑:程序博客网 时间:2024/05/22 04:39
初学者可以借鉴 http://blog.csdn.net/acm_cxlove/article/details/7854530 博弈讲得比较清楚。
#include <cstring>#include <algorithm>#include <cstdio>#include <cmath>using namespace std;int n,m;int main(){ int cas,x,ans,t; scanf("%d",&cas); while(cas--) { scanf("%d",&n); ans=t=x=0; for(int i=1;i<=n;i++) { scanf("%d",&x); ans^=x; if(x>1) t++; } if ((ans==0 && t>=2) || (ans!=0 && t==0)) { printf("Brother\n"); } else { printf("John\n"); } } return 0;}
0 0
- hdu1907John 简单博弈
- hdu1907John尼姆博弈
- hdu1907John(NIM博弈变形)
- HDU1907John(尼姆博弈-先取光者输)
- hdu1907john
- hdu1907John
- hdu1907John (尼姆博弈,存在一种特殊情况全为1时)
- 简单博弈
- 简单博弈
- 简单博弈
- 简单博弈
- 【异或】HDU1907John
- 简单的拍卖博弈
- POJ 2484 简单博弈
- cf div_124_a(简单博弈)
- 简单博弈10道
- 简单博弈整理
- 简单博弈题
- solr学习第九课程----SolrCloud的安装
- 的非官方大哥的非官方大哥反对过法国、
- Android问题:手电筒功能无法打开闪光灯
- 数据结构JAVA---递归算法
- HDU 1862 EXCEL排序
- hdu1907John 简单博弈
- XX大学CSDN高校俱乐部社团申请书
- HDU 2020 绝对值排序
- android学习路线:如何成长为高级工程师
- linux shell
- OJ刷题之《简单编码》
- Javascript中undefined和not defined有什么区别?
- JAVA中for循环的两种遍历方式
- HDU 1225 Football Score