QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#191129 | #7110. Kuririn MIRACLE | Geospiza | WA | 1ms | 3688kb | C++14 | 1.6kb | 2023-09-29 18:20:47 | 2023-09-29 18:20:47 |
Judging History
answer
#include <bits/stdc++.h>
#define ll long long
#define Ma 1000005
#define ld long double
using namespace std;
ld v,ri,d;
ld pi=acosl(-1);
ld eps=1e-6;
void sol()
{
cin>>v>>ri>>d;
ld len=8.0*sqrtl(2)*ri,ti=len/(2.0*v);
ld go=ti*v+4*ri;
ld ma=ti+(d-go)/(2*v);
ld mi=ti/2+sqrtl((d-go/2)*(d-go/2)+4*ri*ri)/(2.0*v);
// printf("ma=%.8Lf mi=%.8Lf\n",ma,mi);
if (d<=go)
{
ld ans=min(ti,d/v);
printf("%.8Lf\n",ans);
return;
}
//printf("gone\n");
ld ans=d/v;
ti/=2.0;
//printf("ti=%.6Lf\n",ti);
ld le=pi,re=pi*3.0/2.0;
while (re-le>=eps)
{
ld mid=(le+re)/2.0;
ld len=8*ri*(-cosl(mid/2.0));
ld all=ti+len/(v*2.0);
//printf("mid=%.6Lf all=%.6Lf\n",mid,all);
ld dis=d-(2.0*ri+all*v);
ld add=sqrtl(dis*dis+4*ri*ri-dis*4*ri*cosl(pi*3.0/2.0-mid));
ld sita=acosl((dis*dis+add*add-4*ri*ri)/(2.0*dis*add));
ld p=(mid-pi);
ld delta=(4*v*v*cosl(p)*cosl(p)+12*v*v);
ld px=(-2*v*cosl(p)+sqrtl(delta))/2.0;
ld gama=acosl((5*v*v-px*px)/(4*v*v));
ld ok=add/(2.0*v)+all;
//printf("mid=%.10Lf ok=%.10Lf\n",mid,ok);
if (sita-eps>=gama)
le=mid;
else{
//ld ok=add/(2.0*v)+all;
//printf("mid=%.10Lf ok=%.10Lf\n",mid,ok);
ans=min(ans,ok);
re=mid;
}
}
printf("%.8Lf\n",ans);
}
int main()
{
ios::sync_with_stdio(0); cin.tie(0);
ll tt;
cin>>tt;
while (tt--)
sol();
return 0;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3688kb
input:
1 2.00 3 30.0
output:
8.55931062
result:
wrong answer 1st numbers differ - expected: '8.3105799', found: '8.5593106', error = '0.0299294'