//======================================================================================================================
// 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 |
0 ms |
212 KB |
Output is correct |
4 |
Correct |
0 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 |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
3 ms |
340 KB |
Output is correct |
3 |
Correct |
3 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 |
372 KB |
Output is correct |
2 |
Correct |
7 ms |
340 KB |
Output is correct |
3 |
Correct |
6 ms |
340 KB |
Output is correct |
4 |
Correct |
6 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
340 KB |
Output is correct |
2 |
Correct |
6 ms |
340 KB |
Output is correct |
3 |
Correct |
6 ms |
340 KB |
Output is correct |
4 |
Correct |
8 ms |
376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
7 ms |
380 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 |
368 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
84 ms |
1468 KB |
Output is correct |
2 |
Correct |
86 ms |
1492 KB |
Output is correct |
3 |
Correct |
62 ms |
1128 KB |
Output is correct |
4 |
Correct |
131 ms |
1476 KB |
Output is correct |
5 |
Correct |
53 ms |
1076 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
82 ms |
1492 KB |
Output is correct |
2 |
Correct |
77 ms |
1392 KB |
Output is correct |
3 |
Correct |
93 ms |
1556 KB |
Output is correct |
4 |
Correct |
102 ms |
1492 KB |
Output is correct |
5 |
Correct |
123 ms |
1648 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
72 ms |
1620 KB |
Output is correct |
2 |
Correct |
91 ms |
1492 KB |
Output is correct |
3 |
Correct |
95 ms |
1620 KB |
Output is correct |
4 |
Correct |
165 ms |
1852 KB |
Output is correct |
5 |
Correct |
93 ms |
1620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
116 ms |
1856 KB |
Output is correct |
2 |
Correct |
114 ms |
1876 KB |
Output is correct |
3 |
Correct |
111 ms |
1748 KB |
Output is correct |
4 |
Correct |
155 ms |
1876 KB |
Output is correct |
5 |
Correct |
112 ms |
1876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
120 ms |
1856 KB |
Output is correct |
2 |
Correct |
124 ms |
1876 KB |
Output is correct |
3 |
Correct |
102 ms |
1876 KB |
Output is correct |
4 |
Correct |
151 ms |
1876 KB |
Output is correct |
5 |
Correct |
122 ms |
1876 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
472 ms |
8132 KB |
Output is correct |
2 |
Correct |
634 ms |
8116 KB |
Output is correct |
3 |
Correct |
555 ms |
8128 KB |
Output is correct |
4 |
Correct |
762 ms |
8020 KB |
Output is correct |
5 |
Correct |
606 ms |
8020 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
601 ms |
8116 KB |
Output is correct |
2 |
Correct |
698 ms |
8124 KB |
Output is correct |
3 |
Correct |
560 ms |
8120 KB |
Output is correct |
4 |
Correct |
728 ms |
8116 KB |
Output is correct |
5 |
Correct |
677 ms |
8116 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1085 ms |
9684 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
717 ms |
9684 KB |
Output is correct |
2 |
Correct |
781 ms |
9688 KB |
Output is correct |
3 |
Correct |
624 ms |
9684 KB |
Output is correct |
4 |
Correct |
892 ms |
9684 KB |
Output is correct |
5 |
Correct |
735 ms |
9684 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1088 ms |
11220 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
865 ms |
11268 KB |
Output is correct |
2 |
Correct |
910 ms |
11260 KB |
Output is correct |
3 |
Correct |
838 ms |
11340 KB |
Output is correct |
4 |
Execution timed out |
1053 ms |
11220 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
761 ms |
12812 KB |
Output is correct |
2 |
Correct |
952 ms |
12812 KB |
Output is correct |
3 |
Correct |
942 ms |
12828 KB |
Output is correct |
4 |
Execution timed out |
1090 ms |
12756 KB |
Time limit exceeded |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
993 ms |
12816 KB |
Output is correct |
2 |
Execution timed out |
1068 ms |
16044 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
957 ms |
15952 KB |
Output is correct |
2 |
Execution timed out |
1097 ms |
15836 KB |
Time limit exceeded |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1073 ms |
15956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |