LightOj1056 - Olympics(简单数学题)

题目链接:http://lightoj.com/volume_showproblem.php?problem=1056

题意:已知体育场的形状是由一个矩形+两边的两个部分组成,两边的两个部分是属于同一个圆的;并且知道体育场的周长是400米,然后知道了,矩形的长宽之比,求矩形具体的长宽为多少;

根据比例找到圆的半径和对应弧的圆心角即可;

#include <stdio.h>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;
const int N = 2010;
const double eps = 1e-6;
const double PI = acos(-1);

int main()
{
    int T, t = 1, A, B;
    double a, b, r;
    scanf("%d", &T);
    while(T--)
    {
        scanf("%d : %d", &A, &B);
        a = atan(A*1.0/B);
        b = PI - 2*a;
        r = sqrt(B*B/(2-2*cos(b)));
        double l = r*b;
        double length = 200*A/(A+l);
        double width = length*B/A;
        printf("Case %d: %.6f %.6f\n", t++, length, width);
    }
    return 0;
}

时间: 2024-10-14 00:24:30

LightOj1056 - Olympics(简单数学题)的相关文章

Codeforces Round #262 (Div. 2)460A. Vasya and Socks(简单数学题)

题目链接:http://codeforces.com/contest/460/problem/A A. Vasya and Socks time limit per test 1 second memory limit per test 256 megabytes input standard input output standard output Vasya has n pairs of socks. In the morning of each day Vasya has to put o

poj 3117 World Cup(简单数学题)

题目链接:http://poj.org/problem?id=3117 World Cup Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8634   Accepted: 4327 Description A World Cup of association football is being held with teams from around the world. The standing is based on

hdu 2368 Alfredo&#39;s Pizza Restaurant(简单数学题)

转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2368 题目很简单,但是比较恶心,用sqrt WA到死也不过,不用秒过: 忍不住吐槽一下; Problem Description Traditionally after the Local Contest, judges and contestants go to their favourite restaurant,

hdu2374 A Game with Marbles(简单数学题)

转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2374 Problem Description There are n bowls, numbered from 1 to n. Initially, bowl i contains mi marbles. One game step consists of removing one marble from a bowl.

UVA 12714 Two Points Revisited(简单数学题)

转载请注明出处:http://blog.csdn.net/u012860063 题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=4452 题意: 给出两个点组成一条直线,要你任意输出两个点,要求这两点组成的直线和给出的直线垂直(注意输出的点不能有负数): 代码如下: #include <cstdio> int main(

JZOJ5773 简单数学题

escription 话说, 小X是个数学大佬,他喜欢做数学题.有一天,小X想考一考小Y.他问了小Y一道数学题.题目如下: 对于一个正整数N,存在一个正整数T(0<T<N),使得的值是正整数. 小X给出N,让小Y给出所有可能的T.如果小Y不回答这个神奇的大佬的简单数学题,他学神的形象就会支离破碎.所以小Y求你帮他回答小X的问题. Input  一个整数N. Output 第一个数M,表示对于正整数N,存在M个不同的正整数T,使得是整数. 后面是M个数,每一个数代表可能的正整数T(按从小到大的顺

HDU 6467 简单数学题 【递推公式 &amp;&amp; O(1)优化乘法】(广东工业大学第十四届程序设计竞赛)

传送门:http://acm.hdu.edu.cn/showproblem.php?pid=6467 简单数学题 Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission(s): 308    Accepted Submission(s): 150 Problem Description 已知 F(n)=∑i=1n(i×∑j=inCij) 求 F(n) m

geometry(简单数学题)

geometry Accepts: 324 Submissions: 622 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others) Problem Description There is a point PP at coordinate (x,y)(x,y). A line goes through the point, and intersects with the postive p

nyoj1110 一个简单数学题

-个简单的数学题 时间限制:1000 ms  |  内存限制:65535 KB 难度:2 描述    挖掘机技术哪家强,那么问题就来了??     现在有这样一个问题,(A/B) ≡ C%P(P素数,A ≡ 0%B)     已知 B,P, n ≡ A % P; 输入 输入T组数据 输入三个数n,B,P(n,B,P在int范围内) 输出 输出 C 样例输入 1 3 4 5 样例输出 2 提示 "≡" 即为同余 比如:6 ≡ 0%2 , 7 ≡ 2%5 , 5 ≡ 5%7 上传者 ACM