[阶梯博弈] POJ 1704 Georgia and Bob
来源:互联网 发布:vue.js react.js 对比 编辑:程序博客网 时间:2024/05/16 00:30
这个对于两两之间的距离看做一堆石子 这就相当于是一个阶梯博弈
对于阶梯博弈 相当于几个奇数堆的石子在做Nim
因为把偶数堆移到奇数堆 那可以再移到偶数堆 对局面不造成影响
#include<cstdio>#include<cstdlib>#include<algorithm>using namespace std;const int N=1005;int n,a[N];int main(){ int T; freopen("t.in","r",stdin); freopen("t.out","w",stdout); scanf("%d",&T); while (T--){ scanf("%d",&n); for (int i=1;i<=n;i++) scanf("%d",a+i); a[++n]=0; sort(a+1,a+n+1); int sg=0; for (int i=n;i>0;i-=2) if (i-1>0) sg^=a[i]-a[i-1]-1; printf("%s\n",!sg?"Bob will win":"Georgia will win"); } return 0;}
0 0
- poj 1704 Georgia and Bob 阶梯博弈
- POJ 1704:Georgia and Bob 阶梯博弈
- POJ 1704 Georgia and Bob(阶梯博弈)
- [阶梯博弈] POJ 1704 Georgia and Bob
- POJ-1704 Georgia and Bob (阶梯博弈)
- poj 1704 Georgia and Bob(阶梯博弈)
- POJ-1704 Georgia and Bob (阶梯博弈)
- POJ 1704-Georgia and Bob(阶梯博弈)
- poj 1704 Georgia and Bob (阶梯博弈)
- POJ 1704 Georgia and Bob 阶梯尼姆博弈
- POJ 1704 Georgia and Bob ( 阶梯博弈 模板 )
- poj1704 Georgia and Bob(阶梯博弈)
- POJ1704 Georgia and Bob Nim阶梯博弈
- poj1704 Georgia and Bob(阶梯博弈)
- [POJ1704]Georgia and Bob(阶梯博弈)
- poj 1704 Georgia and Bob(博弈)
- POJ 1704(Georgia and Bob-Nim博弈)
- poj 1704 Georgia and Bob 博弈
- window下导入#include "cocos-ext.h" 编译报错
- angularJs 4大核心特性+事例
- webrtc源码下载
- Android Studio使用arr文件配置
- Python(9):深入了解模块
- [阶梯博弈] POJ 1704 Georgia and Bob
- python时区处理
- 纯DOS下安装Linux
- python下载图片到本地
- vue-resource插件使用
- 用python练习日语五十音图
- JavaScript小数计算精度丢失问题解决方案
- Android 面试题整理
- 【知识整理】Hibernate的HQL检索方式使用入门