BUPT OJ148 An Interesting Game
2014-03-11 20:49
453 查看
题目描述
Alice and Bob are very smart guys and they like to play all kinds of games in their spare time. It's amazing that they can always find the best strategy, and that's why they feel bored again and again. Recentlythey invented a new game, as they usually did. The rule of the new game was quite simple. At the beginning of game, they would write down N numbers(labelled from 1 to N) on a paper, and then they take turns(Alice first) to repeat the following operations:
choose a remaining number, and then erase all of its divisors(if it still remains on the paper). Once a number was erased, no one can choose it again. The games ends when all numbers are erased, and the last one who makes the operations wins.
Here comes the problem: who will win the game if both use the best strategy? Find it out quickly, before they get bored of the game again!
输入格式
The first line contains an integer T(1≤T≤1000),indicating the number of test cases.
The next T lines describe all the test cases, each with an integer N(1≤N≤108).
输出格式
For each test case in the input, print one line: "Case #X: Y"(note the blanks!), where X is the test case number (starting with 1) and Y is either "Alice" or "Bob".
输入样例
2 2 1024
输出样例
Case #1: Alice Case #2: Alice
神坑
不管怎么样都是Alice赢, Bob你不反抗么...反抗么....抗么...么...
当时就记得这题坑了半个多小时, 然后就在机房睡着了= = 机房耳机真舒服啊
结果事实上第二场热身赛只打了三个小时左右
然后一觉醒来想出了解答, 果然1Y...求校赛别那么坑orz
什么? 证明? 下次吧, 不过是从同学那里得到了系统的证明 (其实我目测会忘记更新证明的
/*
USER_ID: test#birdstorm
PROBLEM: 148
SUBMISSION_TIME: 2014-03-10 22:28:53
*/
#include <stdio.h>
#include <stdlib.h>
#define For(i,m,n) for(i=m;i<n;i++)
main()
{
int i, j, t, n;
scanf("%d",&t);
For(i,1,t+1){
scanf("%d",&n);
printf("Case #%d: Alice\n",i);
}
return 0;
}
相关文章推荐
- HDUT-2414-An interesting game(最小费用最大流)
- sdut2414 An interesting game 费用流
- HDU - 3295 An interesting mobile game
- HDU 5975 Aninteresting game ( lowbit理解 )
- 【SDUTOJ 2414】An interesting game(最小费用最大流)
- hdu 3295 An interesting mobile game(bfs)
- SDUT 2414 An interesting game(最大费用流)
- xtu summer individual 1 A - An interesting mobile game
- 【SDUT2414】An interesting game——最小费用
- hdu 3295 An interesting mobile game (IDA*)
- HDU 5975 && 2016ICPC大连 E: Aninteresting game(树状数组原理)
- HDU 5975 Aninteresting game(树状数组)
- HDU-3295-An interesting mobile game(BFS+DFS)
- HDU 5975 Aninteresting game (树状数组)
- hdu3295 An interesting mobile game (IDA*)
- hdu 5975 Aninteresting game
- hdu 5975---Aninteresting game(树状数组)
- HDU 5975 Aninteresting game(树状数组原理题)
- 【HDOJ】3295 An interesting mobile game
- HDU 3295 An interesting mobile game