//======================================================================================================================
// 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 <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 << low;
}
# |
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 |
1 ms |
300 KB |
Output is correct |
2 |
Correct |
1 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
340 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
364 KB |
Output is correct |
2 |
Correct |
3 ms |
308 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Incorrect |
4 ms |
312 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
316 KB |
Output is correct |
2 |
Incorrect |
6 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
424 KB |
Output is correct |
2 |
Incorrect |
6 ms |
448 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
6 ms |
432 KB |
Output is correct |
2 |
Incorrect |
9 ms |
340 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
96 ms |
2260 KB |
Output is correct |
2 |
Incorrect |
92 ms |
2544 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
84 ms |
2260 KB |
Output is correct |
2 |
Correct |
84 ms |
2156 KB |
Output is correct |
3 |
Incorrect |
101 ms |
2576 KB |
Output isn't correct |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
100 ms |
2288 KB |
Output is correct |
2 |
Incorrect |
103 ms |
2680 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
121 ms |
2876 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
125 ms |
2968 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
535 ms |
12408 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
645 ms |
12948 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1080 ms |
14076 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
759 ms |
14668 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1039 ms |
15556 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
882 ms |
15860 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
758 ms |
17052 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1010 ms |
17036 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
967 ms |
19656 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1080 ms |
19956 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |