POJ1704:Georgia and Bob (NIM博弈 类似阶梯博弈)
来源:互联网 发布:欧洲杯决赛数据 编辑:程序博客网 时间:2024/05/16 01:07
#include#include#includeusing namespace std;int main(){int T;int n;int P[1010];cin >> T;while (T--){cin >> n;for (int i = 0; i < n; i++){cin >> P[i];}int x = 0;if (n % 2 == 1) P[n++] = { 0 };//如果是奇数个,加一个数,形成一对sort(P, P + n);for (int i = 0; i + 1 < n; i = i + 2){x ^= (P[i + 1] - P[i]-1);}if (x == 0)puts("Bob will win");else puts("Georgia will win");}return 0;}
#include#include #includeusing namespace std;int main(){int T;int n;int P[1010];cin >> T;while (T--){cin >> n;for (int i = 0; i < n; i++){cin >> P[i];}int x = 0;if (n % 2 == 1) P[n++] = { 0 };//如果是奇数个,加一个数,形成一对sort(P, P + n);for (int i = 0; i + 1 < n; i = i + 2){x ^= (P[i + 1] - P[i]-1);}if (x == 0)puts("Bob will win");else puts("Georgia will win");}return 0;}
阅读全文
0 0
- POJ1704:Georgia and Bob (NIM博弈 类似阶梯博弈)
- POJ1704 Georgia and Bob Nim阶梯博弈
- poj1704 Georgia and Bob(阶梯博弈)
- [POJ1704]Georgia and Bob(阶梯博弈)
- poj1704(Nim博弈)Georgia and Bob
- poj1704 Georgia and Bob(阶梯博弈)
- poj1704:Georgia and Bob(阶梯NIM)
- 【博弈】poj1704 Georgia and Bob
- POJ1704 Georgia and Bob(Nim问题)
- 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 (阶梯博弈)
- RabbitMQ如何在命令行下清除消息队列中的所有数据
- Selenium3 元素定位
- LapSRN 超分辨率
- git中Everything up-to-date问题解决方案
- MySQL函数大全 及用法示例
- POJ1704:Georgia and Bob (NIM博弈 类似阶梯博弈)
- 决策树之ID3算法(转)
- [LeetCode] 106. Construct Binary Tree from Inorder and Postorder Traversal
- java整数和byte数组之间的转换
- SVN上传
- 线程安全总结
- 贪吃蛇-----小游戏
- 获取SessionFactory的工具类
- JavaScript Math 对象