浙江财经大学第14届校赛 D (Disport with Jelly) 博弈
2018-03-24 20:51
323 查看
【博弈】
题意: 知道L,R 和x 明确知道x的位置, 两个人 谁去到x 谁就lose
选择
k >x R=K-1
k <x L=k+1
k =x lose
必输的 状态为 1,2,3 x=2 时 夹击 状态, 1,2,3,4,5 x=3 时 夹击状态
必赢 1,2 x=1 | x=2 1,2,3,4 无论x= 多少 都是必赢
当L,R 放大时 都可以 归结到上述情况, 故 可发现 当 L,R 长度为奇数 时 中间状态必lose 其余一定win
【code】#include <iostream>
#include <bits/stdc++.h>
using namespace std;
int main()
{
int t;
scanf("%d",&t);
int cot=0;
while(t--)
{
int l,r,x;
scanf("%d %d %d",&l,&r,&x);
if((l-r+1)%2==0)
{
printf("Case #%d: Alice\n",++cot);
}
else
{
if((l+r)/2==x)
printf("Case #%d: Bob\n",++cot);
else
printf("Case #%d: Alice\n",++cot);
}
}
return 0;
}
123
Disport with Jelly |
相关文章推荐
- 第十四届浙江财经大学程序设计竞赛 D Disport with Jelly【NIM】
- 浙江财经大学第14届校赛 F Formula One (思维)
- 第14届 浙江财经大学 校赛热身赛
- Codeforces Round #432 (Div. 2) (Codeforces 850C) E. Arpa and a game with Mojtaba 博弈+状态压缩
- 解题报告:Codeforces Round #432 (Div. 2) E.Arpa and a game with Mojtaba (博弈)
- OTA update fail: Jelly Bean to KitKat with selinux
- UESTC 1661 Playing With Stones 博弈打表
- [Codeforces 451A] Game With Sticks (博弈)
- 浙江财经大学校赛热身赛
- 【博弈 && dfs】URAL 2104 Game with a Strip
- sgu153 Playing with matches (博弈dp)#by nobody
- [Easy] CodeForces - 897D Ithea Plays With Chtholly | 贪心博弈
- 2016多校赛 1003(博弈)
- Codeforces Round #184 (Div. 2) E. Playing with String(博弈)
- 【博弈】GameWithTree
- 2017 山东理工第九届校赛 H C~K玩游戏(博弈)
- SGU 153 - Playing with matches(博弈)
- Codeforces Gym 100379G Wythoff’s game with three piles 博弈
- SGU 153 Playing with matches (博弈,循环节)
- CSUST 第九届校赛G-Dating with girls(二分)