POJ 2975 Nim <Nim 博弈>
来源:互联网 发布:热云数据 编辑:程序博客网 时间:2024/04/20 14:47
题目:http://poj.org/problem?id=2975
简单的Nim博弈
#include <iostream>#include <cstdio>#include <cstring>using namespace std;int main(){ int n; int a[1005]; int k,ans; while(scanf("%d",&n)&&n) { memset(a,0,sizeof(a)); k = 0; ans = 0; for(int i=0;i<n;i++) { scanf("%d",&a[i]); k^=a[i]; } for(int i =0;i<n;i++) { if(k^a[i] < a[i]) //优先级问题 ans++; } printf("%d\n",ans); } return 0;}
0 0
- POJ 2975 Nim <Nim 博弈>
- [POJ](2975)Nim ---Nim博弈(博弈)
- poj 2975 Nim(博弈)
- POJ 2975 Nim(nim博弈)
- POJ-2975-Nim(Nim博弈)
- POJ 2975 Nim(博弈)
- poj 2234 博弈-Nim
- poj 2975 Nim 尼姆博弈
- poj 3840 (nim博弈)
- POJ 2068 NIM (博弈DP)
- 【博弈】poj 2960 S-Nim
- poj 2068 NIM 博弈+dp
- poj 2068 NIM (博弈DP)
- poj 1704 (nim博弈)
- POJ 2068 Nim(博弈+dp)
- POJ 2960 S-Nim(博弈)
- POJ 3480 John (Nim博弈)
- POJ 2068 Nim 博弈DP
- Spring之整合Apache CXF框架实现WebServices远程调用
- 卡特兰数(Catalan Number)
- JavaSE面试题【每天一整理】
- UVA - 202 Repeating Decimals
- Notepad++进行php开发所必需的插件【转】
- POJ 2975 Nim <Nim 博弈>
- Codeforces Round #364 (Div. 2) B. Cells Not Under Attack 标记数组
- Git从菜鸟到入门到放弃
- java-基础-异常
- Bestcoder-Aaronson
- sql语句优化(一)
- java值传递,引用传递
- TCP/IP协议栈及OSI参考模型详解
- 杭电ACM--HDU-2053a/b+c/d和HDU-2504又见gcd