poj-1704 nim变形
来源:互联网 发布:开源网络管理软件 编辑:程序博客网 时间:2024/06/05 15:36
#include<stdio.h>#include<iostream>#include<math.h>#include<stdlib.h>#include<ctype.h>#include<algorithm>#include<vector>#include<string.h>#include<queue>#include<stack>#include<set>#include<map>#include<sstream>#include<time.h>#include<malloc.h>using namespace std;int n,m;int p[1030];int main (){ cin>>m; while (m--) { cin>>n; for(int i=0;i<n;i++ ) cin>>p[i]; if ( n % 2 == 1 ) p[n++]= 0; sort(p,p+n); int ans = 0; for (int i=0 ;i+1<n;i+=2) { ans ^= (p[i+1] - p[i] -1); } if (ans !=0) puts("Georgia will win"); else puts("Bob will win"); } return 0;}
0 0
- poj-1704 nim变形
- POJ 1704 Georgia and Bob <Nim变形>
- POJ 1704 Georgia and Bob (Nim游戏变形)
- poj 1704 Nim取子变形(一路向左)
- POJ 1704 Georgia and Bob (博弈 Nim游戏变形)
- POJ 3480 John Anti-Nim博弈变形
- poj 2960 S-Nim Nim博弈变形 有限取法
- POJ 2975 Nim(尼姆博弈的变形)
- poj 1740 A New Stone Game nim变形
- poj 3537 Crosses and Crosses(NIM变形)@
- Nim博弈变形(anti-nim)
- Nim(Nim博弈变形)
- Nim游戏变形之一
- hdu 1907(NIM 变形)
- Nim 游戏及其变形
- hdu1907John(NIM博弈变形)
- poj 1704 (nim博弈)
- poj 1704(转化成nim)
- hbase原理
- 猜数
- boost 1.57在VC2012里编译出错以及解决
- javascript数据类型强制转换
- 自定义UITableViewCell (通过代码实现:每个CELL格式不一样)
- poj-1704 nim变形
- iOS7——UIControlEventTouchDown延迟响应问题
- Thetest
- 安装svn客户端和vs2012的svn插件之后,在项目右键菜单里没有“更新项目至最新版本”和“提交项目变更”选项
- POJ - 2886 Who Gets the Most Candies?(线段树)
- SVN安装配置使用
- Java Secret: Using an enum to build a State machine(Java秘术:用枚举构建一个状态机)
- 练手小项目(2)-生活小助手--星座运势查询
- AmqpTemplate-发送-接收-消息