[CodeForces - 197A] A - Plate Game
A - Plate Game
You've got a rectangular table with length a and width b and the infinite number of plates of radius r. Two players play the following game: they take turns to put the plates on the table so that the plates don't lie on each other (but they can touch each other), and so that any point on any plate is located within the table's border. During the game one cannot move the plates that already lie on the table. The player who cannot make another move loses. Determine which player wins, the one who moves first or the one who moves second, provided that both players play optimally well.
Input
A single line contains three space-separated integers a, b, r (1 ≤ a, b, r ≤ 100) — the table sides and the plates' radius, correspondingly.
Output
If wins the player who moves first, print "First" (without the quotes). Otherwise print "Second" (without the quotes).
Example
5 5 2
First
6 7 4
Second
Note
In the first sample the table has place for only one plate. The first player puts a plate on the table, the second player can't do that and loses.
In the second sample the table is so small that it doesn't have enough place even for one plate. So the first player loses without making a single move.
题目大意就是有一个a*b的地方,在上面放半径为r的圆,要求圆两两不能相交(可以相切),也不能越出边界,两人轮流放,最后谁胜.
一开始并没有思路,就先去扛T2,T3了.后来T4一直WA,就回来想T1了.看了看大家的提交,代码长度都很短,我就纳闷了--------会不会是O(1)的?
后来想了一下,第一个操作的人如果可以放,他会放在哪里?应该是正中间.为什么?
因为先手放了一个正中间后,后手要么没地方放,要么有,但是先手也有,而且先手的操作与之对称,这样先手总是不会先面临不能放的局面.
所以,如果先手第一个放的下,那他就必胜了.
#include<cstdio>
using namespace std;
int main(){
int a,b,r; scanf("%d%d%d",&a,&b,&r);
*r>a||*r>b) puts("Second"); else puts("First");
;
}
[CodeForces - 197A] A - Plate Game的更多相关文章
- ACM: CodeForces 140A New Year Table-数学几何
CodeForces 140A New Year Table Time Limit:2000MS Memory Limit:262144KB 64bit IO Format:%I64d ...
- Codeforces Gym 100500F Problem F. Door Lock 二分
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/at ...
- Codeforces Round #300(A.【字符串,多方法】,B.【思维题】,C.【贪心,数学】)
A. Cutting Banner time limit per test:2 seconds memory limit per test:256 megabytes input:standard i ...
- Codeforces Round #300(Div. 2)-538A.str.substr 538B.不会 538C.不会 。。。
A. Cutting Banner time limit per test 2 seconds memory limit per test 256 megabytes input standard i ...
- Codeforces 1072 - A/B/C/D - (Done)
链接:http://codeforces.com/contest/1072/ A - Golden Plate - [计算题] #include<bits/stdc++.h> using ...
- Codeforces gym 101343 A. On The Way to Lucky Plaza【概率+逆元+精度问题】
2017 JUST Programming Contest 2.0 题目链接:http://codeforces.com/gym/101343/problem/A A. On The Way to ...
- Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2)
Codeforces Round #517 (Div. 2, based on Technocup 2019 Elimination Round 2) #include <bits/stdc++ ...
- codeforces #516---ABC
A---golden plate http://codeforces.com/contest/1072/problem/A 题意:给一个n*m的格子,从最外层往里涂色,每次尽量涂最外面的那一圈,两圈涂 ...
- Codeforces Round #300 A. Cutting Banner 水题
A. Cutting Banner Time Limit: 1 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/contest/538/pro ...
随机推荐
- ESP8266 使用
ESP8266 微机使用串口和ESP8266建立通信,ESP8266把消息通过wifi发送出去 助手软件 网络调试助手 串口调试助手 AT指令 指令 作用 AT 测试是否进入AT模式 AT+RST 重 ...
- Linux命令之locate命令
1.locate locate 命令是文件搜索命令,它的搜索速度比 find 命令更快,原因在于它不搜索具体目录, 而是搜索一个数据库,这个数据库包含本地所有文件信息.Linux系统自动创建这个数据库 ...
- 小程序之image图片实现宽度100%,高度自适应
哇 今天搞了半天 图片一直变形啊啊啊啊 宽度100% 高度给100% 给auto 完全不管用啊啊啊啊 然后最后最终!!!! 首先我们要给我们的图片一个100%的宽度!让它自适应!! .g ...
- np.split()和np.array_split()
来自:爱抠脚的coder np.split(): 该函数的参数要么按照数字划分(int),要么是按列表list划分:如果仅是输入一个int类型的数字,你的数组必须是均等的分割,否则会报错. np.ar ...
- webpack2的配置属性说明entry,output,state,plugins,node,module,context
Webpack2配置属性详解 webpack说明 webpack是前端构建的一个核心所在,如果说后端构建就是把高级语言代码编译成机器码,那么前端的构建就是重新组合原有的代码,虽然并不编译成机器码,但实 ...
- 查询选修了全部课程的学生姓名_如何解?-MS-SQLServer/应用实例
查询选修了全部课程的学生姓名:student 是学生表 course 是选课表 sc 是课程表select snamefrom studentwhere not exists(select *from ...
- js,java时间处理
1.JS获取时间格式为“yyyy-MM-dd HH:mm:ss”的字符串 function getTimeStr(){ var myDate = new Date(); var year = myDa ...
- 牛客网NOIP赛前集训营-普及组(第一场)C 括号
括号 思路: dp 状态:dp[i][j]表示到i位置为止未匹配的 '(' 个数为j的方案数 状态转移: 如果s[i] == '(' dp[i][j] = dp[i-1][j] + dp[i-1][j ...
- spring集成JMS访问ActiveMQ
首先我们搭建一个spring-mvc项目,项目可以参考:spring-mvc 学习笔记 步骤: 在pom.xml中加上需要的包 修改web.xml,增加IOC容器 spring配置文件applicat ...
- [mybatis-spring]sqlSessionFactoryBean
在mybatis中,SqlSessionFactory由SqlSessionFactoryBuilder创建. 在mybatis-spring中,是由SqlSessionFactoryBean创建的. ...