[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 ...
随机推荐
- jenkins+ant+jmeter自动化性能测试平台
jenkins+ant+jmeter自动化性能测试平台 Jmeter是性能测试的工具,java编写.开源,小巧方便,可以图形界面运行也可以在命令行下运行.网上已经有人使用ant来运行,http://w ...
- gulp的使用介绍及技巧
gulp的使用介绍及技巧 转载: https://www.cnblogs.com/2050/p/4198792.html 1.gulp的安装 首先确保你已经正确安装了nodejs环境.然后以全局方式安 ...
- Codeforces 786 B. Legacy
题目链接:http://codeforces.com/contest/786/problem/B 典型线段树优化连边,线段树上的每一个点表示这个区间的所有点,然后边数就被优化为了至多${nlogn}$ ...
- [Python]IO密集型任务 VS 计算密集型任务
所谓IO密集型任务,是指磁盘IO.网络IO占主要的任务,计算量很小.比如请求网页.读写文件等.当然我们在Python中可以利用sleep达到IO密集型任务的目的. 所谓计算密集型任务,是指CPU计算占 ...
- P1262 间谍网络
传送门 思路: ①在 Tarjan 的基础上加一个 belong 记录每个点属于哪个强连通分量. ②存图完成后,暴力地遍历全图,查找是否要间谍不愿受贿. inline void dfs(int u) ...
- Easy Graphics Engine vs2015使用
vs2017: 下载 https://pan.baidu.com/s/1qWxAgeK 里面的 “ege19.01_vs2017 (推荐, 修正win10 1809 上无法正常运行的问题).zip” ...
- C# 使用 protobuf 进行对象序列化与反序列化
protobuf 是 google的一个开源项目,可用于以下两种用途: (1)数据的存储(序列化和反序列化),类似于xml.json等: (2)制作网络通信协议. 源代码下载地址:https://gi ...
- MATLAB数据类型
数据类型 1数值类型 @整数 *浮点型转整数型的转换函数,将数值转换为最为接近的整数值,若分数部分为0.5时,转换为最接近的两个整数中绝对值较大的一个. *取整函数: floor(x)向下取整 cei ...
- 《剑指offer》第五十六题(数组中只出现一次的两个数字)
// 面试题56(一):数组中只出现一次的两个数字 // 题目:一个整型数组里除了两个数字之外,其他的数字都出现了两次.请写程序 // 找出这两个只出现一次的数字.要求时间复杂度是O(n),空间复杂度 ...
- 认识flask框架
1.框架的基本认识: 特点:用Python语言实现的轻量.简洁.扩展性强. 核心:werkzeug和Jinja2 2.虚拟环境: 创建:mkvirtualenv -p python3 名称 进入:wo ...