题目链接:1336: Lucky Boy

参考博客:LUCKY BOY 博弈——HandsomeHow

Description

Recently, Lur have a good luck. He is also the cleverest boy in his school as he create the most popular computer game – Lucky Boy. The game is played by two players, a and b, in 2d planar .In the game Lucky Boy, there are n different points on plane, each time one can remove one or multiple co-line points from the plane. The one who can firstly remove more than two points from the plane wins. The one who removes the last point on the plane can also win the game. You may assume that two players are both clever enough that they can always make the best choice. The winner is called Lucky Boy.

Given the n points, can you tell me who will be the Lucky Boy ? Note that player a will always the first one to remove points from the plane.

在一个二维平面,有 n 个不同的点,每次可以从平面上拿走一个点或者在一条直线上的多个点。先拿走两个以上的点或者拿走最后一个点的人获胜。问谁获胜?

Input

The first line of each case is an integer n(0<n<=103), following n lines each contains two integers x and y(0<=x, y<=108), describing the coordinates of each point. Ended by EOF.

Output

Output “a is the lucky boy.” in a single line if a win the game, otherwise you should output “b is the lucky boy.” in a single line.

Sample Input

3
0 0
1 1
2 2
3
0 0
1 1
2 3
4
0 0
1 1
2 2
3 5
4
0 0
0 1
1 1
1 0

Sample Output

a is the lucky boy.
b is the lucky boy.
a is the lucky boy.
a is the lucky boy.

分析

WUSTOJ 1336: Lucky Boy(Java)博弈的更多相关文章

  1. WUSTOJ 1285: Factors(Java)

    1285: Factors 参考   hadis_fukan的博客--wustoj 1285 Factors 题目   输入一个数n,找出1~n之间(包括1,n)的质因子最多的数(x)的质因子个数(f ...

  2. WUSTOJ 1327: Lucky Numbers(Java)

    题目链接:1327: Lucky Numbers Description A lucky number is made by the following rules: Given a positive ...

  3. WUSTOJ 1319: 球(Java)并查集

    题目链接:1319: 球 参考:wustoj 1319 球-wust_tanyao,并查集 并查集系列:WUSTOJ 1346: DARK SOULS(Java)并查集 Description Icy ...

  4. WUSTOJ 1283: Hamster(Java)

    1283: Hamster 参考博客 wust_tanyao的博客 题目   第0个月有1对仓鼠.仓鼠的寿命是M个月,仓鼠成年后每个月生一对仓鼠(一雌一雄),问N个月后有仓鼠多少对.更多内容点此链接 ...

  5. WUSTOJ 1282: Start(Java)

    1282: Start 题目   判断一个字符串是不是回文串.例如:"abcba"是回文串.更多内容点击标题. 分析   水题,自己思考. 代码 /** * time 838ms ...

  6. WUSTOJ 1349: TLE(Java)算法优化

    题目链接:1349: TLE Description WH在刷题时,设计出了如下代码: #include<stdio.h> int main() { int i, j, cnt, k, N ...

  7. WUSTOJ 1347: GCD(Java)互质

    题目链接:1347: GCD Description 已知gcd(a,b)表示a,b的最大公约数. 现在给你一个整数n,你的任务是在区间[1,n)里面找到一个最大的x,使得gcd(x,n)等于1. I ...

  8. WUSTOJ 1326: Graph(Java)费马数

    题目链接:1326: Graph 参考博客:HNUSTOJ-1617 Graph(费马数)--G2MI Description Your task is to judge whether a regu ...

  9. WUSTOJ 1325: Distance(Java)坐标计算

    题目链接:1325: Distance Description There is a battle field. It is a square with the side length 100 mil ...

随机推荐

  1. python mongo存在插入不存在更新,同时指定如果不存在才插入的字段

    python爬虫的任务数据操作的小技巧 好久没写公众号了,最近太忙了,这里就不多说了.直接根据需求上代码,我想这个应该是大家比较喜欢的, 需求 爬取某网站的项目列表页,获取其url,标题等信息,作为后 ...

  2. UDP如何实现可靠传输

    概述 UDP不属于连接协议,具有资源消耗少,处理速度快的优点,所以通常音频,视频和普通数据在传送时,使用UDP较多,因为即使丢失少量的包,也不会对接受结果产生较大的影响. 传输层无法保证数据的可靠传输 ...

  3. Assignment4:闰年判断输入异常时的处理方法

    一.问题描述 在输入界面输入年份,界面返回是否为闰年. 判断依据为:输入的数字可以被4整除但不可以被100整除 || 输入的数字可以被400整除 如果输入为数字以外的其他字符,会抛出异常.那么如何防止 ...

  4. php手记之08-tp5中间件

    01-创建中间件 php think make:middleware 中间件的名称 这个指令会 application/http/middleware目录下面生成一个中间件文件. 02-注册中间件三种 ...

  5. Visual C++2010的使用

    Tools->Settings>Rest... 还原所有设置 运行程序:"D:\Program Files\VCExpress\Install\Microsoft Visual ...

  6. log4j实现日志自动清理功能

    log4j不支持自动清理功能,但是log4j2版本支持,log4j2是log4j的升级版,比logback先进. log4j升级为log4j2(不需要改动代码)https://blog.csdn.ne ...

  7. Visual Studio IronPython CPython

    安装 IronPython - 张善友 - 博客园https://www.cnblogs.com/shanyou/archive/2006/09/14/504580.html VS2017作为pyth ...

  8. YII2 composer update 报错解决一例-requires bower-asset/jquery 2.2

    ➜  yii-advanced composer update Loading composer repositories with package information Updating depe ...

  9. c# 验证

    public class RegularExpressionsHelper { /// <summary> /// 对用户名进行格式进行检查的正则表达式 /// </summary& ...

  10. prometheus + influxdb + grafana + mysql

    前言 本文介绍使用influxdb 作为prometheus持久化存储和使用mysql 作为grafana 持久化存储的安装方法 一 安装go环境 如果自己有go环境可以自主编译remote_stor ...