# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
633259 | 2022-08-22T02:35:15 Z | afatpotato | Mobile (BOI12_mobile) | C++14 | 1000 ms | 56804 KB |
#include <bits/stdc++.h> using namespace std; bool solve(double x); vector<pair<double, double> > tower; long long n, l; int main() { cin >> n >> l; tower.resize(n); for (int i = 0; i < n; i++) { cin >> tower[i].first >> tower[i].second; } double low = 0; double high = 4e9; double ans = 0; while (high - low > 1e-4) { double mid = (low + high) / 2; if (solve(mid)) { ans = mid; high = mid; } else { low = mid; } } cout << fixed; cout << setprecision(9); cout << ans << endl; } bool solve(double x) { vector<pair<double, double> > v; for (int i = 0; i < n; i++) { if (tower[i].second > x) { continue; } double d = sqrt(x * x - tower[i].second * tower[i].second); if (tower[i].first + d < 0) { continue; } v.push_back(make_pair(max(tower[i].first - d, (double) 0), max(tower[i].first + d, (double) 0))); } sort(v.begin(), v.end()); if (v[0].first > 0) { return false; } double r = v[0].second; for (int i = 1; i < v.size(); i++) { if (r < v[i].first) { return false; } else { r = max(r, v[i].second); } } if (r < l) { return false; } return true; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 212 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 6 ms | 468 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 632 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 624 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 9 ms | 904 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Runtime error | 139 ms | 7516 KB | Execution killed with signal 11 |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 265 ms | 5572 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 281 ms | 5812 KB | Output is correct |
2 | Correct | 351 ms | 6232 KB | Output is correct |
3 | Correct | 366 ms | 5988 KB | Output is correct |
4 | Incorrect | 305 ms | 7420 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 346 ms | 7132 KB | Output is correct |
2 | Correct | 457 ms | 7052 KB | Output is correct |
3 | Correct | 460 ms | 6540 KB | Output is correct |
4 | Incorrect | 322 ms | 7556 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 213 ms | 6988 KB | Output is correct |
2 | Correct | 442 ms | 6912 KB | Output is correct |
3 | Correct | 485 ms | 6548 KB | Output is correct |
4 | Incorrect | 265 ms | 7432 KB | Output isn't correct |
5 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1089 ms | 28488 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1069 ms | 32560 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1090 ms | 40804 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1065 ms | 45424 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1083 ms | 44888 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1092 ms | 50344 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1093 ms | 48872 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1079 ms | 54928 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1096 ms | 56804 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1089 ms | 49076 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |