2015百度之星資格賽1004_放盤子


///////////////////////////////////////////////////////////////////////////////////////////////////////
作者:tt267
聲明:本文遵循以下協議自由轉載-非商用-非衍生-保持署名|Creative Commons BY-NC-ND 3.0
轉載請註明:http://blog.csdn.net/tt2767/article/details/45970117
///////////////////////////////////////////////////////////////////////////////////////////////////////


題目鏈接:http://bestcoder.hdu.edu.cn/contests/contest_showproblem.php?cid=584&pid=1004

仔細看給的提示和樣例,如果小度能把第一個放進去,那麼他必然贏,因爲偶數邊正多邊形都是對稱的,如果只能放進去一個也是小度贏,所以說。。。。

#include<iostream>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
using namespace std;
#define PI acos(-1.0)
int main()
{
    int n,id=1,Case;
    double l,a,r;
    scanf("%d",&Case);
    while(Case--)
    {
        scanf("%d%lf%lf",&n,&a,&r);
        printf("Case #%d:\n",id++);
        l = a/(tan(PI/n)) ;
        printf("%s\n",l > 2*r?"Give me a kiss!":"I want to kiss you!");
    }

}
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章