博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Game HDU - 3389 (博弈论)
阅读量:4652 次
发布时间:2019-06-09

本文共 1329 字,大约阅读时间需要 4 分钟。

Bob and Alice are playing a new game. There are n boxes which have been numbered from 1 to n. Each box is either empty or contains several cards. Bob and Alice move the cards in turn. In each turn the corresponding player should choose a non-empty box A and choose another box B that B<A && (A+B)%2=1 && (A+B)%3=0. Then, take an arbitrary number (but not zero) of cards from box A to box B. The last one who can do a legal move wins. Alice is the first player. Please predict who will win the game.

InputThe first line contains an integer T (T<=100) indicating the number of test cases. The first line of each test case contains an integer n (1<=n<=10000). The second line has n integers which will not be bigger than 100. The i-th integer indicates the number of cards in the i-th box.OutputFor each test case, print the case number and the winner's name in a single line. Follow the format of the sample output.Sample Input

221 271 3 3 2 2 1 2

Sample Output

Case 1: AliceCase 2: Bob 题意: 编号可以满足B
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define fuck(x) cout<<#x<<" = "<
<
View Code

 

转载于:https://www.cnblogs.com/ZGQblogs/p/10522278.html

你可能感兴趣的文章
各种域名解析的区别
查看>>
centos6.4搭建apache+mysql+php环境 ...
查看>>
Linux下安装和运行Wireshark
查看>>
python iter()的使用 迭代器 生成器的使用
查看>>
八数码块
查看>>
课后作业4
查看>>
VS11将拥有更好的单元测试工具和Fakes框架
查看>>
Linux Kernel 3.8.1 发布
查看>>
MFC程序出现“Debug Assertion Failed! File:dlgdata.cpp Line: 43 ”错误
查看>>
【并发】2、AtomicReferenceFieldUpdater初体验
查看>>
NOIP幂次方
查看>>
liferay MVCActionCommand的用法及例子
查看>>
用OpenGL实现跳跃的立体小球
查看>>
解析XML文件
查看>>
安装配置GitLab
查看>>
使用 Nuget安装DLL
查看>>
18 Surprises From Reading jQuery’s Source Code
查看>>
004 方法反射
查看>>
根据 url 下载图片到本地
查看>>
node vue 开发环境部署时,外部访问页面出现: Invalid Host header 服务器域名访问出现的问题...
查看>>