# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
948285 |
2024-03-18T03:24:20 Z |
Amaarsaa |
Mobile (BOI12_mobile) |
C++14 |
|
313 ms |
16332 KB |
#include<bits/stdc++.h>
using namespace std;
using ll = long long ;
ll n, l;
ll x[1000005], y[1000005];
bool Can(double R) {
double D, x1, x2, mx = 0.0;
for (int j = 1; j <= n; j ++) {
D = (R - y[j]) * (R + y[j]);
D = sqrt(D);
x1 = x[j] - D;
x2 = x[j] + D;
if ( x1 > mx) return false;
mx = max(mx,x2);
}
if ( mx < l) return false;
return true;
}
int main() {
ios::sync_with_stdio(false);
cin.tie(NULL);
ll i;
double lo , hi, mid;
cin >> n >> l;
for (i = 1; i <= n; i ++) {
cin >> x[i] >> y[i];
}
lo = 0;
hi = 2e9;
while (hi - lo > 1e-3) {
mid = (lo + hi)/2;
if (!Can(mid)) lo = mid;
else hi = mid;
}
cout << fixed << setprecision(4) << lo << "\n";
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
2396 KB |
Output is correct |
2 |
Correct |
0 ms |
2508 KB |
Output is correct |
3 |
Incorrect |
1 ms |
2396 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
2396 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Correct |
1 ms |
2392 KB |
Output is correct |
4 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
2392 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
2392 KB |
Output is correct |
2 |
Correct |
1 ms |
2396 KB |
Output is correct |
3 |
Incorrect |
2 ms |
2396 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
2396 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
22 ms |
6744 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
20 ms |
6744 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
20 ms |
6744 KB |
Output is correct |
2 |
Incorrect |
16 ms |
7052 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
18 ms |
6788 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
24 ms |
6796 KB |
Output is correct |
2 |
Incorrect |
21 ms |
6744 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
108 ms |
10880 KB |
Output is correct |
2 |
Correct |
95 ms |
10628 KB |
Output is correct |
3 |
Correct |
105 ms |
10836 KB |
Output is correct |
4 |
Incorrect |
149 ms |
10880 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
85 ms |
10832 KB |
Output is correct |
2 |
Incorrect |
167 ms |
10836 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
133 ms |
14984 KB |
Output is correct |
2 |
Incorrect |
118 ms |
14932 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
97 ms |
14928 KB |
Output is correct |
2 |
Incorrect |
201 ms |
14984 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
153 ms |
14984 KB |
Output is correct |
2 |
Incorrect |
128 ms |
14972 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
126 ms |
14988 KB |
Output is correct |
2 |
Incorrect |
246 ms |
15184 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
182 ms |
14984 KB |
Output is correct |
2 |
Incorrect |
156 ms |
14932 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
131 ms |
14988 KB |
Output is correct |
2 |
Incorrect |
269 ms |
14932 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
220 ms |
16092 KB |
Output is correct |
2 |
Incorrect |
205 ms |
16332 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
157 ms |
15952 KB |
Output is correct |
2 |
Incorrect |
313 ms |
16000 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |