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 ...
随机推荐
- vim 替换所有字符串
将dev 替换 为 prod: :%s/dev/prod/g
- taocrypt
taocrypt MySQL Bugs: #25189: mysqld: coding.cpp:243: void TaoCrypt::Base64Decoder::Decode(): Asserti ...
- python : takes 0 positional arguments but 1 was given
def 的要加self, https://blog.csdn.net/u010269790/article/details/78834410
- OptaPlanner kie-server Forbidden
kie-server Forbidden - 国内版 Binghttps://cn.bing.com/search?q=kie-server+Forbidden&qs=n&form=Q ...
- EDAS Serverless & Kubernetes SLB LVS Nginx
分布式缓存负载均衡的规则处理:虚拟节点对一致性哈希的改进 - yanghuahui - 博客园https://www.cnblogs.com/yanghuahui/p/3755460.html EDA ...
- leetcode 50. Pow(x, n) 、372. Super Pow
50. Pow(x, n) 372. Super Pow https://www.cnblogs.com/grandyang/p/5651982.html https://www.jianshu.co ...
- leetcode 874. Walking Robot Simulation
874. Walking Robot Simulation https://www.cnblogs.com/grandyang/p/10800993.html 每走一步(不是没走commands里的一 ...
- openresty开发系列1--网关API架构及选型
微服务架构在项目中的应用越来越多,我们知道在微服务架构风格中,一个大应用被拆分成为了多个小的服务系统提供出来,这些小的系统他们可以自成体系,也就是说这些小系统可以拥有自己的数据库,框架甚至语言等,这些 ...
- NodeVisitor
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source ...
- URL相关的工具类
package com.opslab.util.web; import com.opslab.util.CharUtil;import com.opslab.util.CharsetUtil;impo ...
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 ...
将dev 替换 为 prod: :%s/dev/prod/g
taocrypt MySQL Bugs: #25189: mysqld: coding.cpp:243: void TaoCrypt::Base64Decoder::Decode(): Asserti ...
def 的要加self, https://blog.csdn.net/u010269790/article/details/78834410
kie-server Forbidden - 国内版 Binghttps://cn.bing.com/search?q=kie-server+Forbidden&qs=n&form=Q ...
分布式缓存负载均衡的规则处理:虚拟节点对一致性哈希的改进 - yanghuahui - 博客园https://www.cnblogs.com/yanghuahui/p/3755460.html EDA ...
50. Pow(x, n) 372. Super Pow https://www.cnblogs.com/grandyang/p/5651982.html https://www.jianshu.co ...
874. Walking Robot Simulation https://www.cnblogs.com/grandyang/p/10800993.html 每走一步(不是没走commands里的一 ...
微服务架构在项目中的应用越来越多,我们知道在微服务架构风格中,一个大应用被拆分成为了多个小的服务系统提供出来,这些小的系统他们可以自成体系,也就是说这些小系统可以拥有自己的数据库,框架甚至语言等,这些 ...
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield * * This library is open source ...
package com.opslab.util.web; import com.opslab.util.CharUtil;import com.opslab.util.CharsetUtil;impo ...