Codeforces Round #124 (Div. 2) A. Plate Game(博弈)
2015-07-10 14:45
465 查看
http://codeforces.com/problemset/problem/197/A
这题竟是div2的A题,比赛的时候完全卡壳了T^T
题意:给出长a宽b的矩阵,两个人轮流在矩阵上放半径为r的圆,不能重叠,两人都采用最优策略,求出谁会赢。
思路:判断是否可以在中间放一个圆,若可以放,便可以在矩阵中以圆为对称放圆,则先手 赢。
若不能放圆,则后手赢。
AC.
#include<iostream>
#include<cstdio>
using namespace std;
int main() {
int a , b , r;
while(scanf("%d%d%d",&a,&b,&r)!=EOF) {
if(2*r > a || 2*r > b) printf("Second\n");
else printf("First\n");
}
}
这题竟是div2的A题,比赛的时候完全卡壳了T^T
题意:给出长a宽b的矩阵,两个人轮流在矩阵上放半径为r的圆,不能重叠,两人都采用最优策略,求出谁会赢。
思路:判断是否可以在中间放一个圆,若可以放,便可以在矩阵中以圆为对称放圆,则先手 赢。
若不能放圆,则后手赢。
AC.
#include<iostream>
#include<cstdio>
using namespace std;
int main() {
int a , b , r;
while(scanf("%d%d%d",&a,&b,&r)!=EOF) {
if(2*r > a || 2*r > b) printf("Second\n");
else printf("First\n");
}
}
相关文章推荐
- Codeforces Round #197 (Div. 2)
- Codeforces Round #198 (Div. 1)
- Codeforces 405E Codeforces Round #238 (Div. 2)E
- Codeforces 407C Codeforces Round #239 (Div. 1)C
- CodeForces 449A - Jzzhu and Chocolate
- CodeForces 449 B. Jzzhu and Cities
- Codeforces Round #265 (Div. 2)
- Codeforces #310 div2 C. Case of Matryoshkas
- 状态压缩DP codeforces 244 Problem C. The Brand New Function 和 codeforces 165 E. Compatible Numbers
- codeforces 16 Problem E fish
- Codeforces round #247 for Div. 2
- Codeforces Round #246 (Div. 2)
- Codeforces #264(div 2)D.Gargari and Permutations
- Codeforces Round #236 (Div. 2)------A,B
- codeforces 257 div2 B
- Codeforces Div2 244AB
- Coder-Strike 2014 - Finals (online edition, Div. 2)AB
- Codeforces Div2 243AB
- Codeforces Div2 242AB
- Codeforces 193 Div 2