//======================================================================================================================
// Name : BOI12_MOBILE.cpp
// Author : Jinchen Li
// Date Created: 5/30/2022
// Description : oj.uz, Mobile in C++, Ansi-style
//======================================================================================================================
// Directives
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <vector>
// Main
int main() {
// Accepting Inputs
int N;
int L;
std::cin >> N >> L;
std::vector<double> x(N);
std::vector<double> y(N);
for (int i = 0; i < N; i++) {
std::cin >> x[i] >> y[i];
}
// Processing Inputs
double low = 1;
double high = 2000000000;
while (static_cast<long long int>(low * 10000) < static_cast<long long int>(high * 10000)) {
double mid = (low + high) / 2;
double cur = 0;
for (int i = 0; i < N; i++) {
double delta = std::sqrt(mid * mid - y[i] * y[i]);
double a = x[i] - delta;
double b = x[i] + delta;
if (a <= cur) {
cur = std::max(cur, b);
}
}
if (cur >= L) {
high = mid;
}
else {
low = mid;
}
}
// Printing Outputs
std::cout << std::fixed << std::setprecision(4) << low;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
340 KB |
Output is correct |
2 |
Correct |
2 ms |
212 KB |
Output is correct |
3 |
Correct |
2 ms |
212 KB |
Output is correct |
4 |
Correct |
4 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
5 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
9 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
376 KB |
Output is correct |
3 |
Correct |
7 ms |
340 KB |
Output is correct |
4 |
Correct |
8 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
340 KB |
Output is correct |
2 |
Correct |
7 ms |
340 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
7 ms |
340 KB |
Output is correct |
5 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
94 ms |
1472 KB |
Output is correct |
2 |
Correct |
94 ms |
1492 KB |
Output is correct |
3 |
Correct |
66 ms |
1128 KB |
Output is correct |
4 |
Correct |
107 ms |
1468 KB |
Output is correct |
5 |
Correct |
44 ms |
980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
80 ms |
1492 KB |
Output is correct |
2 |
Correct |
77 ms |
1388 KB |
Output is correct |
3 |
Correct |
98 ms |
1492 KB |
Output is correct |
4 |
Correct |
100 ms |
1532 KB |
Output is correct |
5 |
Correct |
127 ms |
1652 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
86 ms |
1668 KB |
Output is correct |
2 |
Correct |
98 ms |
1576 KB |
Output is correct |
3 |
Correct |
89 ms |
1640 KB |
Output is correct |
4 |
Correct |
143 ms |
1852 KB |
Output is correct |
5 |
Correct |
93 ms |
1684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
117 ms |
1876 KB |
Output is correct |
2 |
Correct |
110 ms |
1860 KB |
Output is correct |
3 |
Correct |
98 ms |
1876 KB |
Output is correct |
4 |
Correct |
161 ms |
1876 KB |
Output is correct |
5 |
Correct |
117 ms |
1856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
118 ms |
1876 KB |
Output is correct |
2 |
Correct |
112 ms |
1876 KB |
Output is correct |
3 |
Correct |
135 ms |
1856 KB |
Output is correct |
4 |
Correct |
159 ms |
1876 KB |
Output is correct |
5 |
Correct |
121 ms |
1876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
518 ms |
8120 KB |
Output is correct |
2 |
Correct |
590 ms |
8124 KB |
Output is correct |
3 |
Correct |
603 ms |
8116 KB |
Output is correct |
4 |
Correct |
767 ms |
8120 KB |
Output is correct |
5 |
Correct |
631 ms |
8112 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
600 ms |
8120 KB |
Output is correct |
2 |
Correct |
685 ms |
8020 KB |
Output is correct |
3 |
Correct |
536 ms |
8112 KB |
Output is correct |
4 |
Correct |
790 ms |
8120 KB |
Output is correct |
5 |
Correct |
605 ms |
8124 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1091 ms |
9684 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
767 ms |
9692 KB |
Output is correct |
2 |
Correct |
816 ms |
9684 KB |
Output is correct |
3 |
Correct |
596 ms |
9684 KB |
Output is correct |
4 |
Correct |
973 ms |
9804 KB |
Output is correct |
5 |
Correct |
809 ms |
9692 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1084 ms |
11220 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
882 ms |
11248 KB |
Output is correct |
2 |
Correct |
878 ms |
11252 KB |
Output is correct |
3 |
Correct |
762 ms |
11340 KB |
Output is correct |
4 |
Execution timed out |
1031 ms |
11252 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
756 ms |
12816 KB |
Output is correct |
2 |
Correct |
920 ms |
12816 KB |
Output is correct |
3 |
Correct |
933 ms |
12816 KB |
Output is correct |
4 |
Execution timed out |
1083 ms |
12756 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1022 ms |
12812 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1014 ms |
15956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1088 ms |
15956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |