QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#721251 | #9576. Ordainer of Inexorable Judgment | ucup-team902# | WA | 0ms | 4372kb | C++20 | 2.5kb | 2024-11-07 15:41:03 | 2024-11-07 15:41:03 |
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-07 15:41:03]
- 提交
answer
#include <bits/stdc++.h>
using namespace std;
#define cs const
#define re register
#define pb push_back
#define y0 sxxxxx
#define pii pair<int, int>
#define ll long long
#define fi first
#define se second
#define bg begin
#define double long double
template <typename tp>
inline void chemx(tp &a, tp b) { (a < b) ? (a = b) : 0; }
template <typename tp>
inline void chemn(tp &a, tp b) { (a > b) ? (a = b) : 0; }
cs int N = 205;
cs double pi = acos(-1);
#define pd pair<double, double>
cs double eps = 1e-9;
int n, x0, y0, d, t;
vector<pd> inter;
void ins(double l, double r) {
if (l < 0) l += 2 * pi;
if(r<0)r+=2*pi;
if (r > 2 * pi + eps) r -= 2 * pi;
// cout<<l<<" "<<r<<'\n';
if (l + eps < r)
inter.pb(pd(l, r));
else
inter.pb(pd(l, 2 * pi)), inter.pb(pd(0, r));
}
void init() {
sort(inter.begin(), inter.end());
double lst = -1;
vector<pd> res;
for (int i = 0; i < inter.size(); i++) {
lst = inter[i].se;
int j = i;
while (j + 1 < inter.size() && inter[j + 1].fi < lst) {
j++;
lst = max(inter[j].se, lst);
}
res.pb(pd(inter[i].fi, lst));
i = j;
}
inter = res;
}
double calc(pd x, pd y) {
if (x.fi > y.fi) swap(x, y);
if (x.se < y.fi) return 0;
if (x.se > y.se) return y.se - y.fi;
return x.se - y.fi;
}
double query(double l, double r) {
// cout << l << " " << r << '\n';
double ans = 0;
for (pd x : inter) {
ans += calc(x, pd(l, r));
}
return ans;
}
void solve() {
cin >> n >> x0 >> y0 >> d >> t;
double mn=1e9,mx=-1e9;
for (int i = 1; i <= n; i++) {
int x, y;
cin >> x >> y;
double p1 = atan2(y, x);
if(x<0)p1+=pi;
double dis = sqrt(x * x + y * y);
double del = asin(d / dis);
mn=min(mn,p1-del);
mx=max(mx,p1+del);
// cout<<dis<<" "<<d<<'\n';
// cout << p1 << " " << del << '\n';
}
ins(mn,mx);
init();
// for (pd x : inter) cout << x.fi << " " << x.se << '\n';
int cnt = t / (2 * pi);
double res = t - cnt * 2 * pi;
double p0 = atan2(y0, x0);
if(x0<0)p0+=pi;
if(p0<0)p0+=2*pi;
double ans = cnt * query(0, 2 * pi);
if (p0 + res > 2 * pi)
ans = ans + query(p0, 2 * pi) + query(0, p0 + res - 2 * pi);
else
ans = ans + query(p0, p0 + res);
printf("%.12Lf\n", ans);
}
int main() {
// freopen("1.in","r",stdin);
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: 4216kb
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: 4216kb
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: 4248kb
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: 4220kb
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: 4372kb
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: 4264kb
input:
4 1 0 1 10000 -2 3400 -4 10000 -4 -10000 -2 -3400
output:
5002.963820859181
result:
wrong answer 1st numbers differ - expected: '4999.2191154', found: '5002.9638209', error = '0.0007491'