首页 > 其他分享 >XTU 1209 Alice and Bob

XTU 1209 Alice and Bob

时间:2023-04-20 22:42:56浏览次数:41  
标签:XTU cut 1209 int pp Alice Bob rectangle


Alice and Bob

 

 

 

Time Limit : 1000 MS

 

Memory Limit : 65536 KB 



Problem Description

The famous "Alice and Bob" are playing a game again. So now comes the new problem which need a person smart as you to decide the winner. The problem is as follows: They are playing on a rectangle paper, Alice and Bob take turn alternatively, for each turn, a people cut the rectangle vertically or horizontally, the result two rectangle after cut must be IDENTICAL, also the side must be integer, after the cut, one rectangle will be descarded. The first people fail to cut lose the game. Of course, Alice makes first as usual.

Input

First Line contains an integer t indicate there are t cases(1≤t≤1000) For each case: The input consists of two integers w and h(1≤w,h≤1,000,000,000), the size of rectangle.

Output

First output Case number For each case output Alice or Bob, indicate the winner.

Sample Input


21 22 2


Sample Output


Case 1: AliceCase 2: Bob



#include<stdio.h>
int main()
{
    int T,i,j;
    int pp = 0;
    scanf("%d",&T);
    while(T--)
    {
        int x = 0,y = 0;
        pp++;
        int n,m;
        scanf("%d%d",&n,&m);
        while(n%2==0 && n!=0)
        {
            n = n/2;
            x++;
        }
        while(m%2==0 && m!=0)
        {
            m = m/2;
            y++;
        }
        if((x+y)%2 == 0)
        {
            printf("Case %d: Bob\n",pp);
        }
        else
        {
            printf("Case %d: Alice\n",pp);
        }
    }
    return 0;
}





标签:XTU,cut,1209,int,pp,Alice,Bob,rectangle
From: https://blog.51cto.com/u_14834528/6210790

相关文章

  • EasyUI Combobox 组合框
    https://www.jeasyui.net/plugins/169.html 组合框(combobox)显示一个可编辑的文本框和下拉列表,用户可以从下拉列表中选择一个或多个值。用户可以直接输入文本到列表的顶部,或者从列表中选择一个或多个现成的值。依赖combo用法从带有预定义结构的<select>元素创建组合框(c......
  • unigui中TuniComboBox限制只能选择,不能手工输入的方法
    问题:TuniComboBox限制只能选择,不能手工输入确认清楚了,对于UniComboBo没有任何问题,对于UniDBComboBox,该属性就存在一定的问题,初始前,不能设置为csDropDownList,必须为默认的csDropDown,不然初始显示数据信息时,该DB对应的原始数据项目信息不出来,需要在窗口的UniFormAfterShow中再将它......
  • 09 Shading(Texture Mapping)
    1.TextureMapping下图中,不同位置的反射模型是一样的,但是颜色不同,这是因为漫反射系数不同。同样的,一个点应该还存在着很多属性,那么应当如何定义属性。三维图形的表面可以展开为二维平面,这一个二维平面(包含着对应的三维中三角形的属性)便是Texture。如何实行一个好的纹理映射,是......
  • 08 Shading(Shadding, Pipeline and Texture Mapping)
    关键点Real-TimeRenderingPipelineShader1.Graphics(Real-timeRendering)Pipeline管线1.1PipelineMVP,Rasterization,Z-Buffer,Shading,Texture1.2ShaderPrograms着色器通用程序,用于定义任意像素如何操作。来源[1]Games101.闫令琪......
  • OpenAI Translator Bob Plugin Bob for Mac上一款基于ChatGPT全局翻译、润色、语法修
    OpenAITranslatorBobPlugin一款可以在Bob进行即时翻译的插件。它基于OpenAI的GPT系列模型,能够提供高质量、准确的翻译服务。该插件支持多种语言的翻译,包括中文、英文、法语、德语、日语等。用户只需在页面中选中需要翻译的文本,然后点击插件图标即可进行翻译。此外,该插件......
  • 图形学(4)Texture
    TextureUV同法向量插值,在ViewSpace内根据顶点的UV重心插值即可。Bilinear注意到一个像素的UV坐标并不是整数,根据坐标四周的四个整点线性插值即可。Mipmap注意到一个像素代表的纹理并非一个点,在远处可能是很大一块纹理的总和,我们用类似四叉树的Mipmap快速计算一整块......
  • 180114 Sklearn.GaussianMixture中的convaiance_type说明
    协方差矩阵的几何解释sklearn.GaussianMixturecovariance_type:{‘full’,‘tied’,‘diag’,‘spherical’},‘full’(eachcomponenthasitsowngeneralcovariancematrix),‘tied’(allcomponentssharethesamegeneralcovariancematrix),‘diag’(eachcom......
  • Uncaught ReferenceError: bobj is not defined
    创建好的水晶报表,报表没有生成。查看html代码,数据库的数据已经获取...按F12:出现如标题错误。看到此异常,想起来,是因为做少了一件事,即是需要把:C:\inetpub\wwwroot\的as......
  • 用NUnit为.NET程序做测试 --- 常用测试属性之一 SetUp TearDown TestFixtureSetUp Tes
    在前面的入门中,每个测试类运行良好。但是大家有没有发现代码的重复性太多了。每一个测试类中都是先新建一个Calculate有没有方法可以设置得简单些呢?有!NUnit中有一个属性可......
  • wx.ComboBox控件参数详解、用法举例
    wx.ComboBox控件是由一个编辑框和列表组合而成的下拉列表。它可以显示为静态列表带有可编辑或只读文本框,也可以显示为带下拉列表的文本区域,或者是不带文本框的下拉列表。wx......