#include<bits/stdc++.h>
using namespace std;
int sg[1007];
int main(){
int t;
cin>>t;
while(t--){
int n,k;
cin>>n>>k;
if(k%3==0){
n%=(k+1);
if(n==k||n%3)
cout<<"Alice"<<"\n";
else
cout<<"Bob"<<"\n";
}
else{
if(n%3)
cout<<"Alice"<<"\n";
else
cout<<"Bob"<<"\n";
}
/*
cin>>n>>k;
sg[1]=1;
sg[2]=1;
sg[k]=1;
for(int i=3;i<=n;++i){
if(i>=k){
if(sg[i-1]==0||sg[i-2]==0||sg[i-k]==0)
sg[i]=1;
}
else{
if(sg[i-1]==0||sg[i-2]==0)
sg[i]=1;
}
}
for(int i=0;i<=n;++i){
cout<<sg[i]<<"\n";
}*/
//sg函数打表找规律,发现当k是3的倍数时,sg函数以k+1为循环节,当k不是3的倍数时,sg函数以3为循环节
}
return 0;
}

Educational Codeforces Round 68 (Rated for Div. 2)D(SG函数打表,找规律)的更多相关文章

  1. Educational Codeforces Round 68 (Rated for Div. 2)---B

    http://codeforces.com/contest/1194/problem/B /* */ # include <bits/stdc++.h> using namespace s ...

  2. Educational Codeforces Round 68 (Rated for Div. 2)补题

    A. Remove a Progression 签到题,易知删去的为奇数,剩下的是正偶数数列. #include<iostream> using namespace std; int T; ...

  3. Educational Codeforces Round 68 (Rated for Div. 2) C. From S To T (字符串处理)

    C. From S To T time limit per test1 second memory limit per test256 megabytes inputstandard input ou ...

  4. Educational Codeforces Round 68 (Rated for Div. 2) D. 1-2-K Game (博弈, sg函数,规律)

    D. 1-2-K Game time limit per test2 seconds memory limit per test256 megabytes inputstandard input ou ...

  5. Educational Codeforces Round 68 (Rated for Div. 2)-D. 1-2-K Game

    output standard output Alice and Bob play a game. There is a paper strip which is divided into n + 1 ...

  6. Educational Codeforces Round 68 (Rated for Div. 2)-C-From S To T

    You are given three strings ss, tt and pp consisting of lowercase Latin letters. You may perform any ...

  7. Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - C. Magic Ship Time Limit: 2000 mSec P ...

  8. Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems(动态规划+矩阵快速幂)

    Problem   Educational Codeforces Round 60 (Rated for Div. 2) - D. Magic Gems Time Limit: 3000 mSec P ...

  9. Educational Codeforces Round 43 (Rated for Div. 2)

    Educational Codeforces Round 43 (Rated for Div. 2) https://codeforces.com/contest/976 A #include< ...

随机推荐

  1. 【Thinkphp】记录一次分页的实现

    thinkphp分页非常简单 1,控制器渲染数据: $studentList = StudentDb::paginate(5); $this->view->assign('list',$s ...

  2. 安装ipython[win/linux]

    首先以win7  64位系统, python2.7.9为例,linux见底部 1.下载材料http://files.cnblogs.com/files/smileyes/ipython-win64.z ...

  3. 使用git上传项目解决码云文件次数上传限制(原文)

    起因:个人免费版的码云上传文件时限制: 1个小时内只能上传20个文件 解决方法:在码云创建空的项目仓库,使用git客户端下载码云的项目,把需要上传的文件复制到该项目中去,用git提交! 1.配置git ...

  4. C#中对虚拟属性和抽象属性的重写有什么异同

           public abstract class A         {             //抽象属性不能有实现代码             public abstract strin ...

  5. Git 常用命令总结,掌握这些,轻松驾驭版本管理

    原创 最近公司的代码管理工具要从SVN转到Git上,因此虽然之前用过Git,但是都是一些简单的推送提交,因此还是有必要进行一些系统的学习,这里做一下笔记,以备后询,且不定期更新. 关于SVN和Git的 ...

  6. AcWing 851. spfa求最短路 边权可能为负数。 链表 队列

    #include <cstring> #include <iostream> #include <algorithm> #include <queue> ...

  7. iframe子页面之间值传递

    <div style="width:100%;height: 100%;"> <div style="width:74%;height: 70%;flo ...

  8. 【资源分享】Gmod-Expression2 - 自定义像素画生成

    *作者:BUI* 可自定义制作属于你的像素画(默认为Sans) 第77行的COLOR可编辑你想要的颜色(RGB值) 1,2,3,4分别代表第77行所定义的颜色(0代表不显示) 视频地址:传送链接 @n ...

  9. 【游戏体验】Haunted House(鬼屋历险记)

    >>>点此处可试玩无敌版<<< 这款游戏可谓是经典,很多人的童年都有过它的陪伴,不妨重拾当年的快乐 个人测评 游戏性 9/10 音乐 7/10 剧情 4/10 总评 ...

  10. Petr and a Combination Lock

    Petr has just bought a new car. He's just arrived at the most known Petersburg's petrol station to r ...