题目链接: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

  1. 3
  2. 0 0
  3. 1 1
  4. 2 2
  5. 3
  6. 0 0
  7. 1 1
  8. 2 3
  9. 4
  10. 0 0
  11. 1 1
  12. 2 2
  13. 3 5
  14. 4
  15. 0 0
  16. 0 1
  17. 1 1
  18. 1 0

Sample Output

  1. a is the lucky boy.
  2. b is the lucky boy.
  3. a is the lucky boy.
  4. 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. PostgreSQL定时自动备份

    PostgreSQL定时自动备份 简介 PostgreSQL数据库中未提供数据库的定时备份功能,所以需要结合备份和定时job功能来共同实现. 这里我选取了2种定时job方式,crontab是Linux ...

  2. element-ui表格显示html格式

    <el-table-column type="String" label="内容" prop="tpl" width="58 ...

  3. Mono Features of cheat engine

    If you attach to a process/game that uses mono, you should see a new "Mono" menu item on t ...

  4. c++ curl 登陆renren.com (cookie的使用)<转>

    size_t write_callback( void *ptr, size_t size, size_t nmemb, void *stream ) { int len = size * nmemb ...

  5. Java_jdbc 基础笔记之一 数据库连接

    方式一: 1.创建一个Driver实现类的对象 2.准备连接数据库的基本信息:url,user,password 3.调用Driver接口的connect(url,info)获取数据库连接 * Dri ...

  6. npm install 时 No matching version found for react-flow-design@1.1.14

    执行 npm install时报错如下: 4017 silly pacote range manifest for react-highcharts@^16.0.2 fetched in 19ms40 ...

  7. 从Windows转mac遇到的一些坑

    本屌由于运气,分了一台imac来办公,由于以前一直都在用windows,现在用Mac有很多不适应的地方.下面介绍一下Mac与Windows有明显区别的地方: mac与windows鼠标滑轮方向不同. ...

  8. Spring的@ExceptionHandler和@ControllerAdvice统一处理异常

    之前敲代码的时候,避免不了各种try..catch, 如果业务复杂一点, 就会发现全都是try…catch try{ ..........}catch(Exception1 e){ ......... ...

  9. Jrebel激活方法(转)

    本次服务长期稳定提供给各位同学使用哦!服务器地址:https://jrebel.qekang.com/{GUID}在线GUID地址:在线生成GUID如果失效刷新GUID替换就可以!打开jrebel 激 ...

  10. [ kvm ] 学习笔记 9:WebVirtMgr 基础及安装使用

    目录- 1. 前言- 2. webvirtmgr 简介- 3. webvirtmgr 部署实践    - 3.1 配置 webvirtmgr 主机    - 3.2 kvm node节点配置    - ...