QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#800433 | #9576. Ordainer of Inexorable Judgment | Hanoist | WA | 0ms | 2408kb | C++14 | 1.7kb | 2024-12-06 10:38:09 | 2024-12-06 10:38:10 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-12-06 10:38:09]
- 提交
answer
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<functional>
#include<utility>
#include<cassert>
using namespace std;
const int N = 111;
#define pi acos(-1)
int n;
struct vec{
double x,y;
}a[N],sl[N << 1];
double sx,sy,d,t;
inline double Dis(vec a,vec b){
return 1.0 * sqrt((a.y - b.y) * (a.y - b.y) + (a.x - b.x) * (a.x - b.x));
}
bool cmp(vec u,vec v){
if(u.x != v.x) return u.x < v.x;
return u.y < v.y;
}
int main(){
int i,j,k,x,y;
vec O = {0,0};
scanf("%d %lf %lf %lf %lf",&n,&sx,&sy,&d,&t);
for(i = 1;i <= n;i++){
scanf("%lf %lf",&a[i].x,&a[i].y);
}
for(i = 1;i <= n;i++){
double p = atan2(a[i].y,a[i].x);
double q = abs(acos(d / Dis(a[i],O)));
sl[i].x = p + q - pi / 2,sl[i].y = p - q + pi / 2;
//printf("%lf %lf\n",sl[i].x,sl[i].y);
}
sort(sl + 1,sl + n + 1,cmp);
for(i = 1;i <= n;i++) sl[i + n] = {sl[i].x + 2 * pi,sl[i].y + 2 * pi};
double res1,res2,res;
for(i = 1;i <= n;i++){
if(sl[n + i - 1].y - sl[i].x <= pi){
res1 = sl[n + i - 1].y - sl[i].x;
k = i;
break;
}
}
res = (int)(t / 2 / pi) * res1;
t -= 2 * pi * (int)(t / 2 / pi);
double st = atan2(sy,sx);
//printf("%lf %lf %lf\n",st,sl[k].x,sl[n + k - 1].y);
if(sl[n + k - 1].y - st > 2 * pi) st += 2 * pi;
if(st < sl[k].x) res += min(res1,max(0.0,t - (sl[k].x - st)));
else if(st <= sl[n + k - 1].y) res += min(sl[n + k - 1].y - st,t);
else res += min(res1,max(0.0,t - (sl[k].x + 2 * pi - st)));
printf("%.12lf\n",res);
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 2364kb
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: 2312kb
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: 2408kb
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: 2348kb
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: 2408kb
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: -100
Wrong Answer
time: 0ms
memory: 2352kb
input:
4 1 0 1 10000 -2 3400 -4 10000 -4 -10000 -2 -3400
output:
4999.209756572959
result:
wrong answer 1st numbers differ - expected: '4999.2191154', found: '4999.2097566', error = '0.0000019'