# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
551289 |
2022-04-20T08:24:27 Z |
narcissus |
Mobile (BOI12_mobile) |
C++17 |
|
950 ms |
15932 KB |
#include <iostream>
#include <algorithm>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
int n, l;
cin >> n >> l;
pair<long long, long long> coords[n];
for (int i = 0; i < n; i++) {
cin >> coords[i].first >> coords[i].second;
}
double low = 1, high = 2e9;
while (high - low > 1e-3) {
double mid = low + (high - low) / 2;
// cout << mid << ":" << endl;
double maxv = 0;
for (int i = 0; i < n; i++) {
long long x = coords[i].first;
long long y = coords[i].second;
double xdist = sqrt(abs(pow(mid, 2) - pow(y, 2)));
double a1 = max((double)0, x - xdist);
double a2 = min((double)l, x + xdist);
// cout << "a " << a1 << ' ' << a2 << endl;
if (a1 <= maxv)
maxv = max(maxv, a2);
}
if (maxv >= l) {
high = mid;
} else {
low = mid;
}
}
cout << fixed << setprecision(4) << high << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
212 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
6 ms |
288 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
340 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
52 ms |
1440 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
78 ms |
1500 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
1652 KB |
Output is correct |
2 |
Correct |
76 ms |
1492 KB |
Output is correct |
3 |
Incorrect |
59 ms |
1600 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
74 ms |
1748 KB |
Output is correct |
2 |
Correct |
72 ms |
1748 KB |
Output is correct |
3 |
Incorrect |
74 ms |
1840 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
79 ms |
1840 KB |
Output is correct |
2 |
Correct |
78 ms |
1832 KB |
Output is correct |
3 |
Incorrect |
63 ms |
1748 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
328 ms |
8100 KB |
Output is correct |
2 |
Correct |
382 ms |
8020 KB |
Output is correct |
3 |
Correct |
489 ms |
8140 KB |
Output is correct |
4 |
Incorrect |
478 ms |
8020 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
412 ms |
8100 KB |
Output is correct |
2 |
Incorrect |
369 ms |
8096 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
352 ms |
9664 KB |
Output is correct |
2 |
Correct |
464 ms |
9660 KB |
Output is correct |
3 |
Correct |
451 ms |
9676 KB |
Output is correct |
4 |
Incorrect |
611 ms |
9660 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
488 ms |
9664 KB |
Output is correct |
2 |
Incorrect |
456 ms |
9664 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
410 ms |
11228 KB |
Output is correct |
2 |
Correct |
556 ms |
11220 KB |
Output is correct |
3 |
Correct |
536 ms |
11340 KB |
Output is correct |
4 |
Incorrect |
676 ms |
11236 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
567 ms |
11228 KB |
Output is correct |
2 |
Incorrect |
504 ms |
11232 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
504 ms |
12796 KB |
Output is correct |
2 |
Correct |
626 ms |
12796 KB |
Output is correct |
3 |
Correct |
584 ms |
12880 KB |
Output is correct |
4 |
Incorrect |
839 ms |
12792 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
641 ms |
12796 KB |
Output is correct |
2 |
Incorrect |
592 ms |
12792 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
581 ms |
15928 KB |
Output is correct |
2 |
Correct |
787 ms |
15924 KB |
Output is correct |
3 |
Correct |
729 ms |
15932 KB |
Output is correct |
4 |
Incorrect |
950 ms |
15932 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
823 ms |
15924 KB |
Output is correct |
2 |
Incorrect |
730 ms |
15924 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |