放盘子
Accepts: 270
Submissions: 674
Time Limit: 2000/1000 MS (Java/Others)
Memory Limit: 65536/65536 K (Java/Others)
解题报告:
Hint已经说得很清楚了,先手只要能放到中间,就能赢,那么其实就是求解中间能不能放进去,多边形中心到边的距离小于等于盘子半径就可以,正切公式求一下。
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
#include <set>
#include <queue>
#include <vector>
using namespace std;
#define max(x, y) ((x) > (y) ? (x) : (y))
#define min(x, y) ((x) < (y) ? (x) : (y))
#define PI 3.1415926
int main()
{
//freopen("input.txt", "r", stdin);
int times;
scanf("%d", ×);
for (int i = 1; i <= times; ++i)
{
printf("Case #%d:\n", i);
int n;
float a, r;
scanf("%d %f %f", &n, &a, &r);
if ((a/2)/tan(PI/n) >= r)
{
printf("Give me a kiss!\n");
}
else
{
printf("I want to kiss you!\n");
}
}
return 0;
}