# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
973111 |
2024-05-01T13:50:18 Z |
njoop |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
33984 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.0001 < r) {
mid = (l+r)/2;
if(solve(mid)) {
r = mid;
} else {
l = mid + 0.0001;
}
}
cout << fixed << setprecision(6) << l;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Incorrect |
0 ms |
344 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 |
600 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 |
7 ms |
604 KB |
Output is correct |
2 |
Correct |
7 ms |
756 KB |
Output is correct |
3 |
Correct |
9 ms |
604 KB |
Output is correct |
4 |
Incorrect |
12 ms |
604 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
175 ms |
4816 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
201 ms |
4824 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
117 ms |
4820 KB |
Output is correct |
2 |
Correct |
204 ms |
4824 KB |
Output is correct |
3 |
Correct |
182 ms |
4856 KB |
Output is correct |
4 |
Incorrect |
331 ms |
4816 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
212 ms |
4812 KB |
Output is correct |
2 |
Correct |
270 ms |
4812 KB |
Output is correct |
3 |
Correct |
220 ms |
4816 KB |
Output is correct |
4 |
Incorrect |
333 ms |
4812 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
146 ms |
4812 KB |
Output is correct |
2 |
Correct |
275 ms |
5068 KB |
Output is correct |
3 |
Correct |
222 ms |
4816 KB |
Output is correct |
4 |
Incorrect |
268 ms |
4812 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
773 ms |
18424 KB |
Output is correct |
2 |
Execution timed out |
1022 ms |
17132 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1020 ms |
17168 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
866 ms |
29416 KB |
Output is correct |
2 |
Execution timed out |
1016 ms |
29120 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1066 ms |
29168 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1062 ms |
30184 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1004 ms |
29892 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
32448 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1060 ms |
33020 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1016 ms |
33272 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1028 ms |
33984 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |