QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#728748 | #9576. Ordainer of Inexorable Judgment | ucup-team3802# | WA | 0ms | 3936kb | C++23 | 1.6kb | 2024-11-09 15:49:43 | 2024-11-09 15:49:58 |
Judging History
你现在查看的是最新测评结果
- [2024-12-23 14:23:26]
- hack成功,自动添加数据
- (/hack/1303)
- [2024-12-06 11:32:56]
- hack成功,自动添加数据
- (/hack/1271)
- [2024-11-14 21:58:28]
- hack成功,自动添加数据
- (/hack/1181)
- [2024-11-09 15:49:43]
- 提交
answer
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
#define all(a) a.begin(), a.end()
#define rep(i, a, b) for(ll i = a; i < b; i++)
ld PI = acosl(-1);
ld PI2 = PI * 2;
ld mod_PI2(ld x){
rep(i, 0, 100000){
if(x + PI2 * i >= 0){
x += PI2 * i;
break;
}
}
rep(i, 0, 100000){
if(x - PI2 * (i+1) < 0){
x -= PI2 * i;
break;
}
}
return x;
}
void solve(){
ll n,x,y,d,t;
cin >> n >> x >> y >> d >> t;
ld first = atan2l(y, x);
vector<ld> th1,th2;
rep(i, 0, n){
ll dx,dy;
cin >> dx >> dy;
ld th = atan2l(dy, dx);
ld dth = atan2l(d, sqrtl((dx * dx + dy * dy) - d * d));
th1.push_back(mod_PI2(th + dth));
th2.push_back(mod_PI2(th - dth));
}
sort(all(th1)); // mx
sort(all(th2)); // mn
ld mx, mn;
rep(i, 0, n){
if(mod_PI2(th1[i] - th1[(i+1)%n]) <= PI) mx = th1[i];
if(mod_PI2(th2[i] - th2[(i+1)%n]) <= PI) mn = th2[(i+1)%n];
}
ld ans = 0;
ld mt = mod_PI2(t);
ans += (t - mt) / PI2 * mod_PI2(mx - mn);
mt = mod_PI2(mt - first);
mx = mod_PI2(mx - first);
mn = mod_PI2(mn - first);
if(mx < mn){
if(mx < mt) ans += mx;
else ans += mt;
if(mn < mt) ans += mt - mn;
}else{
if(mn < mt){
ans += min(mx, mt) - mn;
}
}
cout << fixed << setprecision(20) << ans << endl;
}
int main(){
int t = 1;
while(t--){
solve();
}
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3856kb
input:
3 1 0 1 1 1 2 2 1 2 2
output:
1.00000000000000000000
result:
ok found '1.0000000', expected '1.0000000', error '0.0000000'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3800kb
input:
3 1 0 1 2 1 2 2 1 2 2
output:
1.57079632679489661915
result:
ok found '1.5707963', expected '1.5707963', error '0.0000000'
Test #3:
score: 0
Accepted
time: 0ms
memory: 3936kb
input:
3 1 0 1 10000 1 2 2 1 2 2
output:
2500.70775225747541758992
result:
ok found '2500.7077523', expected '2500.7077523', error '0.0000000'
Test #4:
score: 0
Accepted
time: 0ms
memory: 3868kb
input:
3 10000 10000 1 10000 10000 9999 10000 10000 9999 10000
output:
0.38424130029026482876
result:
ok found '0.3842413', expected '0.3842413', error '0.0000000'
Test #5:
score: -100
Wrong Answer
time: 0ms
memory: 3848kb
input:
3 -10000 -10000 10000 10000 -10000 -9999 -10000 -10000 -9999 -10000
output:
2500.55135363829675765324
result:
wrong answer 1st numbers differ - expected: '2500.2406700', found: '2500.5513536', error = '0.0001243'