G. The jar of divisors
time limit per test

2 seconds

memory limit per test

64 megabytes

input

standard input

output

standard output

Alice and Bob play the following game. They choose a number N to play with. The rules are as follows:

- They write each number from 1 to N on a paper and put all these papers in a jar.

- Alice plays first, and the two players alternate.

- In his/her turn, a player can select any available number M and remove its divisors including M.

- The person who cannot make a move in his/her turn wins the game.

Assuming both players play optimally, you are asked the following question: who wins the game?

Input

The first line contains the number of test cases T (1  ≤  T  ≤  20). Each of the next T lines contains an integer (1  ≤  N  ≤  1,000,000,000).

Output

Output T lines, one for each test case, containing Alice if Alice wins the game, or Bob otherwise.

Examples
Input
2
5
1
Output
Alice
Bob
这道题我自己都有点迷茫,是个博弈题,结论就是n%6==1?"Bob":"Alice"
#include <iostream>
#include <cstdio>
#include <cstring>
#include <queue>
#include <cmath>
#include <map>
#include <vector>
#include <algorithm>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>y?x:y)
#define min(x,y) (x<y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define PI 3.141592653589793238462
#define INF 0x3f3f3f3f3f
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
int main()
{
ll t,n;
scanf("%lld",&t);
while(t--)
{
cin>>n;
if(n%==) puts("Bob");
else puts("Alice");
}
return ;
}

Gym 100952 G. The jar of divisors的更多相关文章

  1. Gym 100952G&&2015 HIAST Collegiate Programming Contest G. The jar of divisors【简单博弈】

    G. The jar of divisors time limit per test:2 seconds memory limit per test:64 megabytes input:standa ...

  2. codeforces gym 100952 A B C D E F G H I J

    gym 100952 A #include <iostream> #include<cstdio> #include<cmath> #include<cstr ...

  3. Gym 100952 D. Time to go back(杨辉三角形)

    D - Time to go back Gym - 100952D http://codeforces.com/gym/100952/problem/D D. Time to go back time ...

  4. Gym 100952 H. Special Palindrome

    http://codeforces.com/gym/100952/problem/H H. Special Palindrome time limit per test 1 second memory ...

  5. Gym 100952 F. Contestants Ranking

    http://codeforces.com/gym/100952/problem/F F. Contestants Ranking time limit per test 1 second memor ...

  6. Gym 100952 D. Time to go back

    http://codeforces.com/gym/100952/problem/D D. Time to go back time limit per test 1 second memory li ...

  7. Gym 100952 C. Palindrome Again !!

    http://codeforces.com/gym/100952/problem/C C. Palindrome Again !! time limit per test 1 second memor ...

  8. Codeforces Gym 100513G G. FacePalm Accounting

    G. FacePalm Accounting Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100513 ...

  9. Codeforces Gym 100637G G. #TheDress 暴力

    G. #TheDress Time Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100637/problem/G ...

随机推荐

  1. js parseFloat 精度问题

    <script type="text/javascript"> //parseFloat function actionoftext(){var price = 10. ...

  2. bzoj1457: 棋盘游戏 SG函数 Nim

    Code: #include<cstdio> #include<cstring> using namespace std; #define maxn 1003 #define ...

  3. HTML图片映射

    <img>图片映射 <map>与<area>一起使用来定义一个图像映射(一个可点击的链接区域). <img src="cat.jpg" a ...

  4. [洛谷P1939]【模板】矩阵加速(数列)

    题目大意:给你一个数列a,规定$a[1]=a[2]=a[3]=1$,$a[i]=a[i-1]+a[i-3](i>3)$求$a[n]\ mod\ 10^9+7$的值. 解题思路:这题看似是很简单的 ...

  5. Android Studio的Signature Versions选择,分别是什么意思

    转自原文 Android Studio的Signature Versions选择,分别是什么意思 打包一个文件的签名版本, 选V1打包出来的app是jar的(一般这种就是当做第三方导入项目来用的), ...

  6. maven中使用mybatis

    1.Mybatis优缺点 优点: Mybatis实现了对Dao层的封装,隔离了SQL语句,便于管理,避免了像JDBC那样操作数据集,便于扩展等等. 缺点: Mybatis属于?半自动“ORM”,比Hi ...

  7. HDU 4183Pahom on Water(网络流之最大流)

    题目地址:http://acm.hdu.edu.cn/showproblem.php?pid=4183 这题题目意思非常难看懂..我看了好长时间也没看懂..终于是从网上找的翻译. .我就在这翻译一下吧 ...

  8. 权重轮询调度算法 java版本号

    权重轮询调度算法(Weighted Round-Robin Scheduling)--java版本号 因为每台server的配置.安装的业务应用等不同.其处理能力会不一样.所以,我们依据server的 ...

  9. [BZOJ4026]dC Loves Number Theory 欧拉函数+线段树

    链接 题意:给定长度为 \(n\) 的序列 A,每次求区间 \([l,r]\) 的乘积的欧拉函数 题解 考虑离线怎么搞,将询问按右端点排序,然后按顺序扫这个序列 对于每个 \(A_i\) ,枚举它的质 ...

  10. caioj1443:第k小的数Ⅲ

    [传送门:caioj1443] 简要题意: 给出一颗n个点的树,给出每个点的权值,再给出n-1条边,有m个询问,每个询问输入x,y,k,输出第x节点到第y节点的路径上第k大的点 题解: 这是一道主席树 ...