WUSTOJ 1336: Lucky Boy(Java)博弈
题目链接: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)博弈的更多相关文章
- WUSTOJ 1285: Factors(Java)
1285: Factors 参考 hadis_fukan的博客--wustoj 1285 Factors 题目 输入一个数n,找出1~n之间(包括1,n)的质因子最多的数(x)的质因子个数(f ...
- WUSTOJ 1327: Lucky Numbers(Java)
题目链接:1327: Lucky Numbers Description A lucky number is made by the following rules: Given a positive ...
- WUSTOJ 1319: 球(Java)并查集
题目链接:1319: 球 参考:wustoj 1319 球-wust_tanyao,并查集 并查集系列:WUSTOJ 1346: DARK SOULS(Java)并查集 Description Icy ...
- WUSTOJ 1283: Hamster(Java)
1283: Hamster 参考博客 wust_tanyao的博客 题目 第0个月有1对仓鼠.仓鼠的寿命是M个月,仓鼠成年后每个月生一对仓鼠(一雌一雄),问N个月后有仓鼠多少对.更多内容点此链接 ...
- WUSTOJ 1282: Start(Java)
1282: Start 题目 判断一个字符串是不是回文串.例如:"abcba"是回文串.更多内容点击标题. 分析 水题,自己思考. 代码 /** * time 838ms ...
- WUSTOJ 1349: TLE(Java)算法优化
题目链接:1349: TLE Description WH在刷题时,设计出了如下代码: #include<stdio.h> int main() { int i, j, cnt, k, N ...
- WUSTOJ 1347: GCD(Java)互质
题目链接:1347: GCD Description 已知gcd(a,b)表示a,b的最大公约数. 现在给你一个整数n,你的任务是在区间[1,n)里面找到一个最大的x,使得gcd(x,n)等于1. I ...
- WUSTOJ 1326: Graph(Java)费马数
题目链接:1326: Graph 参考博客:HNUSTOJ-1617 Graph(费马数)--G2MI Description Your task is to judge whether a regu ...
- WUSTOJ 1325: Distance(Java)坐标计算
题目链接:1325: Distance Description There is a battle field. It is a square with the side length 100 mil ...
随机推荐
- Gremlin入门
Gremlin入门 一.Gremlin简介 Gremlin是Apache ThinkerPop框架下的图遍历语言,Gremlin是一种函数式数据流语言,可以使用户使用简洁的方式表述复杂的属性图的遍历或 ...
- HttpWebRequest使用时发生阻塞的解决办法
HttpWebRequest使用如下: 第一种:使用Using 释放资源 /// <summary> /// Http Get请求返回数据 /// </summary> /// ...
- 实时查看linux下的日志
cat /var/log/*.log 如果日志在更新,如何实时查看 tail -f /var/log/messages 还可以使用 watch -d -n 1 cat /var/log/message ...
- 多层If语句 和 表格驱动 的对比
网文提到表格驱动,总喜欢拿一层if做例子,然而这样未免也太简单. 下文是三层缩进的if和表驱动比较,大家可自行判断优劣. 业务是这样的,某景点分旺季票价和淡季票价,淡季票为旺季的一半,15岁以下孩子再 ...
- springIoC注解
一.通过注解注入Bean @Component:组件(spring扫描包下有该注解的类) @ComponentScan(包名):组件扫描(spring扫描该包名下的类) @Configuration: ...
- Java开发手册-编程规约精选
# Java开发手册-编程规约精选 ## 总约 - 采用驼峰写法 ## 变量 - 首字母小写 ## 方法 - 方法名首字母小写- 参数首字母小写 ## 引用 - <阿里巴巴Java开发手册> ...
- mysql - ERROR 1114 (HY000): The table is full
mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/73 ...
- linux内核挂载根文件系统时报错”VFS: Cannot open root device "ram0" or unknown-block(0,0): error -6“如何处理?
1. 通过error -6得到: #define ENXIO 6 /* No such device or address */ 2. 解决办法 使能CONFIG_BL ...
- AndoridSQLite数据库开发基础教程(10)
AndoridSQLite数据库开发基础教程(10) 添加触发器 触发器(TRIGGER)是由事件来触发某个操作.这些事件包括INSERT.DELETE.UPDATE和UPDATE OF.当数据库系统 ...
- mysql的备份与还原,安装(window)
之前一直使用的navicat的自动的备份功能.但是在使用navicat的还原功能时,贼慢. 今天要做的是window服务器上将mysql单个数据库备份.然后还原到我的mac笔记本上. 本来以为很快的, ...
1285: Factors 参考 hadis_fukan的博客--wustoj 1285 Factors 题目 输入一个数n,找出1~n之间(包括1,n)的质因子最多的数(x)的质因子个数(f ...
题目链接:1327: Lucky Numbers Description A lucky number is made by the following rules: Given a positive ...
题目链接:1319: 球 参考:wustoj 1319 球-wust_tanyao,并查集 并查集系列:WUSTOJ 1346: DARK SOULS(Java)并查集 Description Icy ...
1283: Hamster 参考博客 wust_tanyao的博客 题目 第0个月有1对仓鼠.仓鼠的寿命是M个月,仓鼠成年后每个月生一对仓鼠(一雌一雄),问N个月后有仓鼠多少对.更多内容点此链接 ...
1282: Start 题目 判断一个字符串是不是回文串.例如:"abcba"是回文串.更多内容点击标题. 分析 水题,自己思考. 代码 /** * time 838ms ...
题目链接:1349: TLE Description WH在刷题时,设计出了如下代码: #include<stdio.h> int main() { int i, j, cnt, k, N ...
题目链接:1347: GCD Description 已知gcd(a,b)表示a,b的最大公约数. 现在给你一个整数n,你的任务是在区间[1,n)里面找到一个最大的x,使得gcd(x,n)等于1. I ...
题目链接:1326: Graph 参考博客:HNUSTOJ-1617 Graph(费马数)--G2MI Description Your task is to judge whether a regu ...
题目链接:1325: Distance Description There is a battle field. It is a square with the side length 100 mil ...
Gremlin入门 一.Gremlin简介 Gremlin是Apache ThinkerPop框架下的图遍历语言,Gremlin是一种函数式数据流语言,可以使用户使用简洁的方式表述复杂的属性图的遍历或 ...
HttpWebRequest使用如下: 第一种:使用Using 释放资源 /// <summary> /// Http Get请求返回数据 /// </summary> /// ...
cat /var/log/*.log 如果日志在更新,如何实时查看 tail -f /var/log/messages 还可以使用 watch -d -n 1 cat /var/log/message ...
网文提到表格驱动,总喜欢拿一层if做例子,然而这样未免也太简单. 下文是三层缩进的if和表驱动比较,大家可自行判断优劣. 业务是这样的,某景点分旺季票价和淡季票价,淡季票为旺季的一半,15岁以下孩子再 ...
一.通过注解注入Bean @Component:组件(spring扫描包下有该注解的类) @ComponentScan(包名):组件扫描(spring扫描该包名下的类) @Configuration: ...
# Java开发手册-编程规约精选 ## 总约 - 采用驼峰写法 ## 变量 - 首字母小写 ## 方法 - 方法名首字母小写- 参数首字母小写 ## 引用 - <阿里巴巴Java开发手册> ...
mysql - ERROR 1114 (HY000): The table is full - Stack Overflowhttps://stackoverflow.com/questions/73 ...
1. 通过error -6得到: #define ENXIO 6 /* No such device or address */ 2. 解决办法 使能CONFIG_BL ...
AndoridSQLite数据库开发基础教程(10) 添加触发器 触发器(TRIGGER)是由事件来触发某个操作.这些事件包括INSERT.DELETE.UPDATE和UPDATE OF.当数据库系统 ...
之前一直使用的navicat的自动的备份功能.但是在使用navicat的还原功能时,贼慢. 今天要做的是window服务器上将mysql单个数据库备份.然后还原到我的mac笔记本上. 本来以为很快的, ...