# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
973109 |
2024-05-01T13:49:19 Z |
njoop |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
49512 KB |
#include <bits/stdc++.h>
#define pi pair<double, double>
using namespace std;
double x, y, L, l=0, r=1e9, mid, de, cov;
pi arr[1000010];
vector<pi> in;
int n;
bool solve(double rad) {
in.clear();
cov = 0;
for(int i=1; i<=n; i++) {
de = pow(rad, 2) - pow(abs(arr[i].second), 2);
de = sqrt(de);
if(de < 0) continue;
in.push_back({arr[i].first-de, arr[i].first+de});
}
sort(in.begin(), in.end());
for(auto i: in) {
if(i.first > cov) return 0;
cov = max(cov, i.second);
if(cov >= L) return 1;
}
return 0;
}
int main() {
cin.tie(0)->sync_with_stdio(0);
cin >> n >> L;
for(int i=1; i<=n; i++) {
cin >> arr[i].first >> arr[i].second;
}
while(l+0.00001 < r) {
mid = (l+r)/2;
if(solve(mid)) {
r = mid;
} else {
l = mid + 0.00001;
}
}
cout << fixed << setprecision(6) << l;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
600 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
464 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 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
13 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
12 ms |
600 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
10 ms |
612 KB |
Output is correct |
2 |
Correct |
7 ms |
756 KB |
Output is correct |
3 |
Correct |
10 ms |
604 KB |
Output is correct |
4 |
Incorrect |
13 ms |
604 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
210 ms |
5480 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
217 ms |
5588 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
131 ms |
5536 KB |
Output is correct |
2 |
Correct |
215 ms |
5796 KB |
Output is correct |
3 |
Correct |
202 ms |
5836 KB |
Output is correct |
4 |
Incorrect |
353 ms |
6636 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
217 ms |
6352 KB |
Output is correct |
2 |
Correct |
297 ms |
6248 KB |
Output is correct |
3 |
Correct |
244 ms |
5848 KB |
Output is correct |
4 |
Incorrect |
379 ms |
6628 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
152 ms |
6352 KB |
Output is correct |
2 |
Correct |
285 ms |
6100 KB |
Output is correct |
3 |
Correct |
241 ms |
5736 KB |
Output is correct |
4 |
Incorrect |
280 ms |
6624 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
773 ms |
21716 KB |
Output is correct |
2 |
Execution timed out |
1053 ms |
26840 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1026 ms |
27468 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
912 ms |
33320 KB |
Output is correct |
2 |
Execution timed out |
1066 ms |
37828 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1057 ms |
37716 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1042 ms |
36192 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1067 ms |
41176 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1055 ms |
39904 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1024 ms |
44996 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1045 ms |
42224 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1006 ms |
49512 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |