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
  1. 2
    5
    1
Output
  1. Alice
    Bob
    这道题我自己都有点迷茫,是个博弈题,结论就是n%6==1?"Bob":"Alice"
  1. #include <iostream>
  2. #include <cstdio>
  3. #include <cstring>
  4. #include <queue>
  5. #include <cmath>
  6. #include <map>
  7. #include <vector>
  8. #include <algorithm>
  9. using namespace std;
  10. #define lowbit(x) (x&(-x))
  11. #define max(x,y) (x>y?x:y)
  12. #define min(x,y) (x<y?x:y)
  13. #define MAX 100000000000000000
  14. #define MOD 1000000007
  15. #define PI 3.141592653589793238462
  16. #define INF 0x3f3f3f3f3f
  17. #define mem(a) (memset(a,0,sizeof(a)))
  18. typedef long long ll;
  19. int main()
  20. {
  21. ll t,n;
  22. scanf("%lld",&t);
  23. while(t--)
  24. {
  25. cin>>n;
  26. if(n%==) puts("Bob");
  27. else puts("Alice");
  28. }
  29. return ;
  30. }
  1.  

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. 大数问题(相加) A + B

    I have a very simple problem for you. Given two integers A and B, your job is to calculate the Sum o ...

  2. iOS开发——导航栏的一些小设置

    1.导航栏的隐藏与显示:navigationBarHidden - (void)viewWillAppear:(BOOL)animated { [super viewWillAppear:YES]; ...

  3. NOIP2017 Day-1 模板荟萃

    #include<bits/stdc++.h> #define MAXN 100005 using namespace std; int read(){ ;char c=getchar() ...

  4. bzoj 1588 [HNOI2002] 营业额统计 链表和Splay

    来自HNOI 2002营业额的统计一题,这题以前是用链表水过的,最近看见许多splay的题,赶紧张一下知识. 题目大意就是对于一个序列,输出每个元素与它之前元素的差的最小值的和.先说链表的方法吧. 大 ...

  5. Git学习笔记 2,GitHub常用命令

    廖雪峰Git教程 莫烦Git教程 莫烦Git视频教程 文件三个状态,add之后从工作区(原始状态)到暂存区,commit之后从暂存区到版本库 工作区 暂存区 版本库 unstage stage mas ...

  6. 【Codeforces Round #420 (Div. 2) A】Okabe and Future Gadget Laboratory

    [题目链接]:http://codeforces.com/contest/821/problem/A [题意] 给你一个n*n的数组; 然后问你,是不是每个位置(x,y); 都能找到一个同一行的元素q ...

  7. Myeclipse学习总结(4)——Eclipse常用开发插件

    (1)    AmaterasUML         介绍:Eclipse的UML插件,支持UML活动图,class图,sequence图,usecase图等:支持与Java class/interf ...

  8. Shell脚本中替换字符串等操作

    在做shell批处理程序时候,常常会涉及到字符串相关操作. 有非常多命令语句.如:awk,sed都能够做字符串各种操作. 事实上shell内置一系列操作符号.能够达到类似效果,大家知道,使用内部操作符 ...

  9. 安卓自己定义对话框及The specified child already has a child问题

    问题:在android开发过程中,有时会在不同情况下遇到同种问题:The specified child already has a parent.You must call removeView() ...

  10. poj--1637--Sightseeing tour(网络流,最大流判断混合图是否存在欧拉图)

    Sightseeing tour Time Limit: 1000MS   Memory Limit: 10000KB   64bit IO Format: %I64d & %I64u Sub ...