QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#753460 | #9576. Ordainer of Inexorable Judgment | forget-star# | WA | 0ms | 3984kb | C++17 | 1.2kb | 2024-11-16 12:59:06 | 2024-11-16 12:59:08 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-11-16 12:59:06]
- 提交
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)
{
L=pai*3.0,R=-pai*3.0;
for(int i=1;i<=2*n;i++)
{
ld t=s[i];
while(t<s0-pai) t+=pai*2.0;
while(t>s0+pai) t-=pai*2.0;
L=min(L,t-s0),R=max(R,t-s0);
}
ld L1=0,R1=R,L2=pai*2.0+L,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,R1))+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: 3984kb
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: 3904kb
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: 3960kb
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: 0
Accepted
time: 0ms
memory: 3908kb
input:
3 10000 10000 1 10000 10000 9999 10000 10000 9999 10000
output:
0.384241300290
result:
ok found '0.3842413', expected '0.3842413', error '0.0000000'
Test #5:
score: 0
Accepted
time: 0ms
memory: 3984kb
input:
3 -10000 -10000 10000 10000 -10000 -9999 -10000 -10000 -9999 -10000
output:
2500.240670009608
result:
ok found '2500.2406700', expected '2500.2406700', error '0.0000000'
Test #6:
score: 0
Accepted
time: 0ms
memory: 3844kb
input:
4 1 0 1 10000 -2 3400 -4 10000 -4 -10000 -2 -3400
output:
4999.219115408743
result:
ok found '4999.2191154', expected '4999.2191154', error '0.0000000'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3984kb
input:
4 1 0 1 10000 -2 3300 -4 10000 -4 -10000 -2 -3300
output:
4999.200391854815
result:
ok found '4999.2003919', expected '4999.2003919', error '0.0000000'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
4 -3040 2716 2147 2 -9033 -8520 -8999 -8533 -8988 -8511 -9004 -8495
output:
0.350830058342
result:
ok found '0.3508301', expected '0.3508301', error '0.0000000'
Test #9:
score: 0
Accepted
time: 0ms
memory: 3908kb
input:
3 8168 -766 1549 1256 -3951 -6425 -3874 -6439 -3911 -6389
output:
84.832861161007
result:
ok found '84.8328612', expected '84.8328612', error '0.0000000'
Test #10:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
8 2977 -3175 8766 2 -4868 7759 -4867 7925 -4867 7950 -4886 7952 -4979 7953 -5048 7877 -5003 7761 -4936 7759
output:
0.327860646906
result:
ok found '0.3278606', expected '0.3278606', error '0.0000000'
Test #11:
score: 0
Accepted
time: 0ms
memory: 3912kb
input:
13 -1715 -4640 267 8651 272 6659 264 6660 208 6664 108 6625 107 6621 93 6564 90 6551 90 6485 124 6474 219 6477 283 6525 288 6591 286 6657
output:
153.589622784682
result:
ok found '153.5896228', expected '153.5896228', error '0.0000000'
Test #12:
score: 0
Accepted
time: 0ms
memory: 3920kb
input:
8 -9743 -7629 775 7 -194 981 -191 1720 -193 1845 -705 1929 -959 1950 -1131 1894 -1151 1604 -1031 1020
output:
2.046006204356
result:
ok found '2.0460062', expected '2.0460062', error '0.0000000'
Test #13:
score: -100
Wrong Answer
time: 0ms
memory: 3900kb
input:
9 -6770 -1426 3491 1918 -2118 2886 -2063 3245 -2122 3709 -2129 3737 -2850 3718 -2984 3650 -3042 3462 -3028 2972 -2688 2888
output:
822.038867773234
result:
wrong answer 1st numbers differ - expected: '822.2411850', found: '822.0388678', error = '0.0002461'