QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#121710 | #860. We apologize for any inconvenience | karuna# | WA | 1ms | 3584kb | C++17 | 1.0kb | 2023-07-08 18:46:44 | 2023-07-08 18:46:47 |
Judging History
answer
#include <bits/stdc++.h>
#define ff first
#define ss second
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
int main() {
cin.tie(0); ios_base::sync_with_stdio(0);
int T; cin >> T;
while (T--) {
int C; cin >> C;
int n; cin >> n;
vector<pair<int, int>> a(n);
for (auto &[x, y] : a) cin >> x >> y;
int x_max = 0;
for (auto [x, y] : a) x_max = max(x_max, x);
long double l = 0, r = 1e18;
for (auto [x, y] : a) {
long double A = 5.0 * x * x / C / C;
long double sq = sqrt((long long)x * x - 4 * A * (A + y));
l = max(l, (x - sq) / (2 * A));
r = min(r, (x + sq) / (2 * A));
}
long double A = 5.0 * x_max / C / C;
l = max(l, (1 - sqrt(1 - 4 * A * A)) / (2 * A));
r = min(r, (1 + sqrt(1 - 4 * A * A)) / (2 * A));
cout.precision(3);
cout << fixed << (l + r) / 2 << '\n';
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3584kb
input:
1 5 4 3 1 3 5 2 1 4 2 2 3 2 2 4 3 1 4 3
output:
-nan
result:
wrong output format Expected integer, but "-nan" found