BUPT OJ148 An Interesting Game

44 篇文章 3 订阅

题目描述

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. Recently they 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(1T1000) , indicating the number of test cases.
The next T lines describe all the test cases, each with an integer  N(1N108) .

输出格式

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;
}


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值