# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1056926 |
2024-08-13T12:28:59 Z |
TimAni |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
40508 KB |
// time-limit: 3000
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double eps = 1E-4;
struct point {
int x{}, y{};
};
void solve() {
int n, L;
cin >> n >> L;
vector<point> p(n);
for(int i = 0; i < n; i++) {
cin >> p[i].x >> p[i].y;
}
auto intersection = [&](const point& A, double R) -> array<double, 2> {
if(abs(A.y) > R) {
return {1e18, -1e18};
}
double D = 1.0 * R * R - 1.0 * A.y * A.y; // divided by 4
double x1 = A.x - sqrt(D);
double x2 = A.x + sqrt(D);
if(x2 < x1) swap(x1, x2);
return {x1, x2};
};
auto good = [&](double R) {
vector<array<double, 2>> segs;
for(int i = 0; i < n; i++) {
if(abs(p[i].y) > R) continue;
segs.push_back(intersection(p[i], R));
}
if(segs.empty()) return false;
sort(segs.begin(), segs.end());
int i = 0;
double r = 0;
while(i + 1 < n && segs[i + 1][0] <= r) {
r = max(r, segs[i + 1][1]); i++;
}
return r >= L;
};
double l = 0, r = 4e9;
while(r - l > eps) {
double R = (r + l) / 2;
if(good(R)) {
r = R;
}
else {
l = R;
}
}
cout << fixed << setprecision(-log10(eps)) << r << endl;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
double T = 1;
//cin >> T;
while(T--) solve();
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
348 KB |
Output is correct |
2 |
Correct |
4 ms |
588 KB |
Output is correct |
3 |
Correct |
3 ms |
348 KB |
Output is correct |
4 |
Correct |
4 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
6 ms |
896 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
7 ms |
716 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
700 KB |
Output is correct |
2 |
Incorrect |
9 ms |
700 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
101 ms |
5176 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
124 ms |
5148 KB |
Execution killed with signal 11 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
191 ms |
4628 KB |
Output is correct |
2 |
Incorrect |
257 ms |
4484 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
258 ms |
4896 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
207 ms |
5520 KB |
Output is correct |
2 |
Incorrect |
330 ms |
4884 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1058 ms |
20412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1056 ms |
20400 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
32704 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1054 ms |
31064 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1042 ms |
36900 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1012 ms |
34932 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1047 ms |
36456 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1062 ms |
36232 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1049 ms |
40508 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1071 ms |
40432 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |