UESTC
来源:互联网 发布:win10网络没有本地连接 编辑:程序博客网 时间:2024/05/19 10:38
Lucky Boy
Time Limit: 3000/1000MS (Java/Others) Memory Limit: 65535/65535KB (Java/Others)
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,
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.
Input
The first line of each case is an integer 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 Sample Output
30 01 12 230 01 12 3
a is the lucky boy.b is the lucky
Sample input and output
#include <iostream>#include <cstdio>#include <cstring>#include <algorithm>#include <cmath>#include <vector>using namespace std;#define ll long long#define ld long doubledouble a[1003][2];int n;int main(){ while(scanf("%d",&n) != EOF) { int sum = 0; for(int i = 0; i < n; i++) { scanf("%lf%lf",&a[i][0],&a[i][1]); } int flag = 0; for(int i = 0; i < n; i++) { for(int j = i+1; j < n; j++) { double a1 = a[j][1]-a[i][1],a2; double b1 = a[i][0]-a[j][0],b2; double c1 = a[j][0]*a[i][1] - a[j][1]*a[i][0],c2; for(int k = j+1; k < n; k++) { a2 = a[k][1]-a[i][1]; b2 = a[i][0]-a[k][0]; c2 = a[k][0]*a[i][1] - a[k][1]*a[i][0]; if((a1*b2 == a2*b1) && a1*c2 == a2*c1) { flag = 1; break; } } if(flag)break; } if(flag)break; } if(flag || n%3 || n <= 2)printf("a is the lucky boy.\n"); else printf("b is the lucky boy.\n"); } return 0;}
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- UESTC
- 【理论实践】快速认识allocator,并不神奇但吓退一片的内存管理机制:内存分配和对象构造分离
- poj 2553 The Bottom of a Graph 强连通缩点
- 记录一 MVC框架
- replaceAll小心使用
- 【《Real-Time Rendering 3rd》 提炼总结】(三) 第三章 · GPU渲染管线与可编程着色器 The Graphics Processing Unit
- UESTC
- 2017年8月17日训练日记
- python第三方包安装错误:Unable to find vcvarsall.bat
- hadoop生态圈列式存储系统--kudu介绍及安装配置
- 【《Real-Time Rendering 3rd》 提炼总结】(二) 第二章 · 图形渲染管线 The Graphics Rendering Pipeline
- strcmp源码解惑
- JAVA 对象引用,以及对象赋值
- Ambari--主机管理
- 今天开通了CNSD博客