# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
973117 |
2024-05-01T13:52:18 Z |
njoop |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
33524 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.001;
}
}
cout << fixed << setprecision(6) << l;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Incorrect |
1 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 |
5 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 |
14 ms |
604 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
600 KB |
Output is correct |
2 |
Correct |
7 ms |
604 KB |
Output is correct |
3 |
Correct |
10 ms |
604 KB |
Output is correct |
4 |
Incorrect |
13 ms |
500 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
179 ms |
4820 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
189 ms |
4812 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
112 ms |
4836 KB |
Output is correct |
2 |
Correct |
197 ms |
4820 KB |
Output is correct |
3 |
Correct |
193 ms |
4648 KB |
Output is correct |
4 |
Incorrect |
329 ms |
4844 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
217 ms |
4812 KB |
Output is correct |
2 |
Correct |
278 ms |
5016 KB |
Output is correct |
3 |
Correct |
214 ms |
4812 KB |
Output is correct |
4 |
Incorrect |
312 ms |
4812 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
136 ms |
4864 KB |
Output is correct |
2 |
Correct |
263 ms |
5836 KB |
Output is correct |
3 |
Correct |
261 ms |
4824 KB |
Output is correct |
4 |
Incorrect |
258 ms |
5068 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
753 ms |
18660 KB |
Output is correct |
2 |
Execution timed out |
1036 ms |
18404 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1016 ms |
17608 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
904 ms |
28864 KB |
Output is correct |
2 |
Execution timed out |
1063 ms |
29124 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1046 ms |
29164 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1006 ms |
29420 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1044 ms |
29436 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1071 ms |
32740 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1059 ms |
33220 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1034 ms |
33524 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
33016 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |