//======================================================================================================================
// 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() {
// Initialisation
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
// 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 |
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 |
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 |
0 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 |
340 KB |
Output is correct |
3 |
Correct |
2 ms |
340 KB |
Output is correct |
4 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
396 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
3 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
4 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
400 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
340 KB |
Output is correct |
2 |
Correct |
4 ms |
340 KB |
Output is correct |
3 |
Correct |
5 ms |
340 KB |
Output is correct |
4 |
Correct |
5 ms |
340 KB |
Output is correct |
5 |
Correct |
4 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
62 ms |
1492 KB |
Output is correct |
2 |
Correct |
52 ms |
1512 KB |
Output is correct |
3 |
Correct |
31 ms |
1108 KB |
Output is correct |
4 |
Correct |
61 ms |
1492 KB |
Output is correct |
5 |
Correct |
30 ms |
1108 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
48 ms |
1540 KB |
Output is correct |
2 |
Correct |
44 ms |
1364 KB |
Output is correct |
3 |
Correct |
51 ms |
1492 KB |
Output is correct |
4 |
Correct |
67 ms |
1492 KB |
Output is correct |
5 |
Correct |
83 ms |
1620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
46 ms |
1692 KB |
Output is correct |
2 |
Correct |
53 ms |
1600 KB |
Output is correct |
3 |
Correct |
45 ms |
1620 KB |
Output is correct |
4 |
Correct |
81 ms |
1876 KB |
Output is correct |
5 |
Correct |
55 ms |
1620 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
70 ms |
1888 KB |
Output is correct |
2 |
Correct |
63 ms |
1876 KB |
Output is correct |
3 |
Correct |
62 ms |
1880 KB |
Output is correct |
4 |
Correct |
103 ms |
1888 KB |
Output is correct |
5 |
Correct |
65 ms |
2000 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
78 ms |
1996 KB |
Output is correct |
2 |
Correct |
59 ms |
1884 KB |
Output is correct |
3 |
Correct |
53 ms |
1876 KB |
Output is correct |
4 |
Correct |
81 ms |
1880 KB |
Output is correct |
5 |
Correct |
73 ms |
1884 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
268 ms |
8140 KB |
Output is correct |
2 |
Correct |
361 ms |
8148 KB |
Output is correct |
3 |
Correct |
311 ms |
8148 KB |
Output is correct |
4 |
Correct |
381 ms |
8148 KB |
Output is correct |
5 |
Correct |
324 ms |
8148 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
348 ms |
8148 KB |
Output is correct |
2 |
Correct |
383 ms |
8080 KB |
Output is correct |
3 |
Correct |
268 ms |
8148 KB |
Output is correct |
4 |
Correct |
417 ms |
8152 KB |
Output is correct |
5 |
Correct |
343 ms |
8148 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1081 ms |
9684 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
403 ms |
9708 KB |
Output is correct |
2 |
Correct |
451 ms |
9716 KB |
Output is correct |
3 |
Correct |
387 ms |
9700 KB |
Output is correct |
4 |
Correct |
480 ms |
9700 KB |
Output is correct |
5 |
Correct |
465 ms |
9804 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1092 ms |
11220 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
468 ms |
11280 KB |
Output is correct |
2 |
Correct |
553 ms |
11220 KB |
Output is correct |
3 |
Correct |
449 ms |
11220 KB |
Output is correct |
4 |
Correct |
572 ms |
11340 KB |
Output is correct |
5 |
Correct |
564 ms |
11276 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
451 ms |
12848 KB |
Output is correct |
2 |
Correct |
552 ms |
12844 KB |
Output is correct |
3 |
Correct |
496 ms |
12856 KB |
Output is correct |
4 |
Correct |
658 ms |
12852 KB |
Output is correct |
5 |
Correct |
541 ms |
12840 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
505 ms |
12844 KB |
Output is correct |
2 |
Correct |
591 ms |
12756 KB |
Output is correct |
3 |
Correct |
500 ms |
12848 KB |
Output is correct |
4 |
Correct |
627 ms |
12836 KB |
Output is correct |
5 |
Correct |
604 ms |
12856 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
531 ms |
15984 KB |
Output is correct |
2 |
Correct |
658 ms |
15888 KB |
Output is correct |
3 |
Correct |
614 ms |
15968 KB |
Output is correct |
4 |
Correct |
811 ms |
15972 KB |
Output is correct |
5 |
Correct |
655 ms |
15980 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
669 ms |
15976 KB |
Output is correct |
2 |
Correct |
750 ms |
15976 KB |
Output is correct |
3 |
Correct |
613 ms |
15972 KB |
Output is correct |
4 |
Correct |
889 ms |
15956 KB |
Output is correct |
5 |
Correct |
690 ms |
15972 KB |
Output is correct |