QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#753430 | #9576. Ordainer of Inexorable Judgment | forget-star# | WA | 0ms | 3980kb | C++17 | 1.0kb | 2024-11-16 12:50:46 | 2024-11-16 12:50:47 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-11-16 12:50:46]
- 提交
answer
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<cmath>
using namespace std;
typedef long double ld;
const int N=110;
const ld pai=acos(-1.0);
struct node
{
ld x,y;
}p0,p[N];
int n,d,T;
ld s[N<<1],s0;
int main()
{
scanf("%d%Lf%Lf%d%d",&n,&p0.x,&p0.y,&d,&T);s0=atan2(p0.y,p0.x);
for(int i=1;i<=n;i++)
{
scanf("%Lf%Lf",&p[i].x,&p[i].y);
ld t=atan2(p[i].y,p[i].x),dt=atan2(d,sqrt(p[i].x*p[i].x+p[i].y*p[i].y-d*d));
s[2*i-1]=t-dt,s[2*i]=t+dt;
}
ld L=pai*3.0,R=-pai*3.0;
for(int i=1;i<=2*n;i++)
{
ld t=s[i];
while(t<s0) t+=pai*2.0;
L=min(L,t-s0),R=max(R,t-s0);
}
// printf("L=%.7Lf R=%.7Lf\n",L,R);
ld ans=0;
if((R-L)>=pai)
{
ld L1=0,R1=L,L2=R,R2=pai*2.0;
ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
ans=t1*((R1-L1)+(R2-L2))+max((ld)0.0,min(t2,L1))+max((ld)0.0,t2-L2);
}
else
{
ld t1=floor(T/(pai*2.0)),t2=T-pai*2.0*t1;
ans=t1*(R-L)+max((ld)0.0,min(t2,R)-L);
}
printf("%.12Lf\n",ans);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 0ms
memory: 3980kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
1.000000000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3980kb
input:
3 1 0 1 2 1 2 2 1 2 2
output:
1.570796326795
result:
ok found '1.5707963', expected '1.5707963', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3952kb
input:
3 1 0 1 10000 1 2 2 1 2 2
output:
2500.707752257475
result:
ok found '2500.7077523', expected '2500.7077523', error '0.0000000'
Test #4:
score: -100
Wrong Answer
time: 0ms
memory: 3976kb
input:
3 10000 10000 1 10000 10000 9999 10000 10000 9999 10000
output:
0.065904673046
result:
wrong answer 1st numbers differ - expected: '0.3842413', found: '0.0659047', error = '0.3183366'