QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#733726 | #9576. Ordainer of Inexorable Judgment | lqh2024 | Compile Error | / | / | C++20 | 2.1kb | 2024-11-10 20:40:36 | 2024-11-10 20:40:36 |
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-10 20:40:36]
- 评测
- 测评结果:Compile Error
- 用时:0ms
- 内存:0kb
- [2024-11-10 20:40:36]
- 提交
answer
#include <bits/stdc++.h>
#include <quadmath.h>
using namespace std;
#define int long long
#define double long double
using f128 = float128_t;
struct point {
double x, y;
};
signed main() {
cin.tie(0) -> sync_with_stdio(0);
int n;
double x0, y0, d, t;
cin >> n >> x0 >> y0 >> d >> t;
vector<point> a(n + 1);
for (int i = 1; i <= n; i++) {
cin >> a[i].x >> a[i].y;
}
double mx = 0, mi = 1e9;
double PI = acos((double)(-1));
auto get = [&](double k, double fen, point a) -> double {
double theta = atan2(f128(k), f128(fen));
if (theta * 2 < PI && a.x < 0) {
theta += PI;
}
if (theta * 2 > -PI && a.x < 0) {
theta += PI;
}
return theta;
};
cerr << (double)atan2q(1, 1);
for (int i = 1; i <= n; i++) {
auto [x, y] = a[i];
if (abs(abs(x) - d) < 1e-9) {
mx = max(mx, max(PI / 2 + (a[i].y < 0 ? PI : 0), get((y * y - d * d), (2 * x * y), a[i])));
mi = min(mi, min(PI / 2 + (a[i].y < 0 ? PI : 0), get((y * y - d * d), (2 * x * y), a[i])));
} else {
double delta = 4 * x * x * y * y - 4 * (d * d - x * x) * (d * d - y * y);
double k1 = (-2 * x * y * (d * d - x * x) * 2 + sqrt(delta));
double k2 = (-2 * x * y * (d * d - x * x) * 2 - sqrt(delta));
mx = max({mx, get(k1, (d * d - x * x) * 2, a[i]), get(k2, (d * d - x * x) * 2, a[i])});
mi = min({mi, get(k1, (d * d - x * x) * 2, a[i]), get(k2, (d * d - x * x) * 2, a[i])});
}
}
auto get_ans = [&](double t) -> double {
double cnt = floor(t / (2 * PI)), res = 0;
t -= cnt * 2 * PI;
if (mx - mi > PI) {
res += cnt * (2 * PI - mx + mi);
res += min(mi, t);
} else {
res += cnt * (mx - mi);
res += max<double>(0, min(mx, t) - mi);
}
return res;
};
cout << fixed << setprecision(12) << get_ans(atan2(y0, x0) + t) - get_ans(atan2(y0, x0)) << "\n";
}
详细
answer.code:6:14: error: ‘float128_t’ does not name a type; did you mean ‘float_t’? 6 | using f128 = float128_t; | ^~~~~~~~~~ | float_t answer.code: In lambda function: answer.code:26:30: error: ‘f128’ was not declared in this scope; did you mean ‘ynf128’? 26 | double theta = atan2(f128(k), f128(fen)); | ^~~~ | ynf128