QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#758435 | #9576. Ordainer of Inexorable Judgment | wyhao | WA | 1ms | 4296kb | C++14 | 1.2kb | 2024-11-17 18:18:57 | 2024-11-17 18:18:58 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-11-17 18:18:57]
- 提交
answer
#include<bits/stdc++.h>
using namespace std;
const int N=105;
typedef double db;
const db eps = 1e-8;
const db pi = acos(-1.0);
int n,d;
db xx0,yy0,t;
db px[N],py[N];
db the[N],theh[N];
db pin[N],pout[N];
db in,out,now,ans,dlt;
int main(){
// freopen("ex.in","r",stdin);
scanf("%d%lf%lf%d%lf",&n,&xx0,&yy0,&d,&t);
for(int i=1;i<=n;i++){
scanf("%lf%lf",&px[i],&py[i]);
theh[i]=asin(d/sqrt((px[i]*px[i]+py[i]*py[i])));
the[i]=atan2(py[i],px[i]);
pin[i]=the[i]-theh[i];
if(pin[i]<=-pi) pin[i]+=2*pi;
pout[i]=the[i]+theh[i];
if(pout[i]<=-pi) pout[i]+=2*pi;
// printf("%lf %lf ",the[i],theh[i]);
// printf("%lf %lf\n",pin[i],pout[i]);
}
in=pin[1];out=pout[1];
for(int i=2;i<=n;i++){
in=min(in,pin[i]);
out=max(out,pout[i]);
}
now = atan2(yy0,xx0);
if(now <= -pi) now += 2*pi;
dlt = out - in;
while(dlt <= -pi) dlt += 2*pi;
while(t>2*pi){
t-=2*pi;
ans += dlt;
}
while(out < in) out +=2*pi;
// printf("%lf %lf\n",in,out);
// printf("%lf\n",now);
// printf("%lf\n",ans);
in -= now;
out -= now;
if(t>=out){
ans += out - max(in,0.0);
}else if(t>=in){
ans += t - max(in,0.0);
}
printf("%.10lf",ans);
return 0;
}
详细
Test #1:
score: 100
Accepted
time: 1ms
memory: 4296kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
1.0000000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 4172kb
input:
3 1 0 1 2 1 2 2 1 2 2
output:
1.5707963268
result:
ok found '1.5707963', expected '1.5707963', error '0.0000000'
Test #3:
score: 0
Accepted
time: 1ms
memory: 4216kb
input:
3 1 0 1 10000 1 2 2 1 2 2
output:
2500.7077522575
result:
ok found '2500.7077523', expected '2500.7077523', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 4216kb
input:
3 10000 10000 1 10000 10000 9999 10000 10000 9999 10000
output:
0.3842413003
result:
ok found '0.3842413', expected '0.3842413', error '0.0000000'
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 4292kb
input:
3 -10000 -10000 10000 10000 -10000 -9999 -10000 -10000 -9999 -10000
output:
2499.4551718412
result:
wrong answer 1st numbers differ - expected: '2500.2406700', found: '2499.4551718', error = '0.0003142'