HDU 4315 Climbing the Hill [阶梯Nim]
2017-03-14 23:13
197 查看
传送门
题意:
和上题基本一样;山顶可以有多人,谁先把king放到山顶谁就胜
并不太明白
题意:
和上题基本一样;山顶可以有多人,谁先把king放到山顶谁就胜
并不太明白
#include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> using namespace std; typedef long long ll; const int N=1005; inline int read(){ char c=getchar();int x=0,f=1; while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();} while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();} return x*f; } int n,k,a ; int main(){ //freopen("in","r",stdin); while(scanf("%d%d",&n,&k)!=EOF){ for(int i=1;i<=n;i++) a[i]=read(); if(k==1) {puts("Alice");continue;} int sg=0; if(k!=2) a[0]=-1; else a[0]=0; for(int i=n;i>=1;i-=2) sg^= a[i]-a[i-1]-1; puts(sg ? "Alice" : "Bob"); } }
相关文章推荐
- hdu 4315 Climbing the Hill(阶梯博弈转nim博弈)
- hdu 4315 Climbing the Hill (阶梯博弈)
- HDU-4315 Climbing the Hill(阶梯博弈变形)
- HDU 4315 Climbing the Hill (阶梯博弈转尼姆博弈)
- HDU 4315 Climbing the Hill Staircase Nim变种
- hdu 4315 Climbing the Hill 博弈问题,可转化为nim游戏问题,多校联合赛(二)第六题
- Climbing the Hill - HDU 4315 阶梯博弈变形
- HDU 4315 Climbing the Hill(阶梯博弈)
- hdu 4315 Climbing the Hill 博弈论
- 【hdu 4315】Climbing the Hill
- HDOJ 题目4315Climbing the Hill(阶梯博弈)
- hdu - 4315 - Climbing the Hill - 博弈
- hdu4315 Climbing the Hill(阶梯博弈)
- [HDU4315]Climbing the Hill(阶梯博弈)
- 【hdoj 4315】Climbing the Hill
- Climbing the Big Nan Hill
- HDU 5996 NIM博弈 // 参考阶梯博弈
- hdu 4315阶梯博弈变形
- hdu 2509 Be the Winner(博弈Nim)
- hdu 2509 Be the Winner(博弈Nim)