欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

HUST 1584 摆放餐桌

程序员文章站 2022-10-05 20:58:46
2019-05-21 19:56:15 https://www.cnblogs.com/ECJTUACM-873284962/p/6390028.html R与r的大小,多种情况进行判断 看题的时候,对数据的严谨性 ......

2019-05-21

19:56:15

https://www.cnblogs.com/ecjtuacm-873284962/p/6390028.html

r与r的大小,多种情况进行判断

看题的时候,对数据的严谨性

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pi 3.1415926

int main()
{
    double n, r, r;
    while(~scanf("%lf %lf %lf", &n, &r, &r))
    {   
        if (r > r)
        {
            cout << "no" << endl;
            continue;
        }
        else if(r == r && n == 1)
        {
            cout << "yes" << endl;
            continue;
        }
        else if(r > r/2 && n == 1)
        {
            cout << "yes" << endl;
            continue;
        }
        else if(r == r/2 && n == 2)
        {
            cout << "yes" << endl;
            continue;
        }
        else
        {
            double a = pi / asin(r / (r - r));
            if (a > n)
            {
                cout << "yes";
            }
            else
            {
                cout << "no";
            }
            cout << endl;
        }
    }
    return 0;
}