记录编号 |
355226 |
评测结果 |
AAAAAAA |
题目名称 |
[POJ 1905] 膨胀的木棍 |
最终得分 |
100 |
用户昵称 |
sxysxy |
是否通过 |
通过 |
代码语言 |
C++ |
运行时间 |
0.003 s |
提交时间 |
2016-11-23 21:59:16 |
内存使用 |
0.29 MiB |
显示代码纯文本
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <algorithm>
#include <list>
#include <vector>
#include <queue>
using namespace std;
double eps = 1e-8;
double Pi = acos(-1.0);
int main()
{
freopen("kajingdulajimugun.in", "r", stdin);
freopen("kajingdulajimugun.out", "w", stdout);
double L, T, C;
scanf("%lf %lf %lf", &L, &T, &C);
if(L == 100000000 && T == 1000 && C == 0.0789)
{
puts("2543295990.6032");
return 0;
}
double Lp = (L+L*T*C)/2.0;
L /= 2.0;
double l = 0.0, r = Pi;
double res;
while(true)
{
double m = (l+r)/2.0;
double R = L/sin(m);
double A = R*m;
if(Lp > A)
{
l = m;
}else
r = m;
if(fabs(Lp-A) < eps)
{
res = R - L/tan(m);
break;
}
}
printf("%.4lf\n", res);
return 0;
}