# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1109853 |
2024-11-07T20:10:22 Z |
vjudge1 |
Mobile (BOI12_mobile) |
C++17 |
|
1000 ms |
27208 KB |
#include <iostream>
#include <vector>
#include <cmath>
#include <iomanip>
using namespace std;
int main() {
int N, L;
cin >> N >> L;
vector<pair<int, int>> tr(N);
for (auto& p : tr) cin >> p.first >> p.second;
double low = 0, high = 3 * 1e9;
while (low + 1e-6 < high) {
double r = (high + low) / 2;
vector<pair<double, double>> s;
for (auto& p : tr) {
if (abs(p.second) >= r) continue;
double x = sqrt(r* r - 1.0 * p.second * p.second);
double x1 = p.first - x, x2 = p.first + x;
// x2 >= s.back().first is always true. That's why we can use merge with stack.
while (!s.empty() && s.back().second >= x1) {
x1 = min(x1, s.back().first);
x2 = max(x2, s.back().second);
s.pop_back();
}
s.push_back({x1, x2});
}
bool ok = false;
for (auto& p : s) {
if (p.first <= 0 && p.second >= L) {
ok = true;
}
}
if (ok) {
high = r;
} else {
low = r;
}
}
cout << fixed << setprecision(5) << high << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
336 KB |
Output is correct |
2 |
Correct |
1 ms |
504 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
504 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
508 KB |
Output is correct |
2 |
Correct |
1 ms |
336 KB |
Output is correct |
3 |
Correct |
1 ms |
336 KB |
Output is correct |
4 |
Correct |
1 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
3 ms |
336 KB |
Output is correct |
2 |
Correct |
3 ms |
336 KB |
Output is correct |
3 |
Correct |
2 ms |
336 KB |
Output is correct |
4 |
Correct |
4 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
336 KB |
Output is correct |
2 |
Correct |
5 ms |
336 KB |
Output is correct |
3 |
Correct |
5 ms |
516 KB |
Output is correct |
4 |
Correct |
4 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
4 ms |
336 KB |
Output is correct |
2 |
Correct |
6 ms |
336 KB |
Output is correct |
3 |
Correct |
5 ms |
508 KB |
Output is correct |
4 |
Correct |
4 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
336 KB |
Output is correct |
2 |
Correct |
6 ms |
336 KB |
Output is correct |
3 |
Correct |
5 ms |
504 KB |
Output is correct |
4 |
Correct |
5 ms |
336 KB |
Output is correct |
5 |
Correct |
4 ms |
336 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
61 ms |
1016 KB |
Output is correct |
2 |
Correct |
89 ms |
1028 KB |
Output is correct |
3 |
Correct |
45 ms |
1464 KB |
Output is correct |
4 |
Correct |
48 ms |
2120 KB |
Output is correct |
5 |
Correct |
30 ms |
1104 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
848 KB |
Output is correct |
2 |
Correct |
42 ms |
848 KB |
Output is correct |
3 |
Correct |
47 ms |
848 KB |
Output is correct |
4 |
Correct |
48 ms |
2068 KB |
Output is correct |
5 |
Correct |
53 ms |
2376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
75 ms |
1104 KB |
Output is correct |
2 |
Correct |
83 ms |
1072 KB |
Output is correct |
3 |
Correct |
76 ms |
1872 KB |
Output is correct |
4 |
Correct |
64 ms |
3116 KB |
Output is correct |
5 |
Correct |
54 ms |
2048 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
103 ms |
1212 KB |
Output is correct |
2 |
Correct |
100 ms |
2620 KB |
Output is correct |
3 |
Correct |
81 ms |
2240 KB |
Output is correct |
4 |
Correct |
64 ms |
3144 KB |
Output is correct |
5 |
Correct |
60 ms |
2376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
102 ms |
1360 KB |
Output is correct |
2 |
Correct |
104 ms |
2620 KB |
Output is correct |
3 |
Correct |
85 ms |
2120 KB |
Output is correct |
4 |
Correct |
64 ms |
2992 KB |
Output is correct |
5 |
Correct |
60 ms |
2376 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
449 ms |
4336 KB |
Output is correct |
2 |
Correct |
531 ms |
11848 KB |
Output is correct |
3 |
Correct |
483 ms |
11336 KB |
Output is correct |
4 |
Correct |
306 ms |
13800 KB |
Output is correct |
5 |
Correct |
291 ms |
11088 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
499 ms |
4176 KB |
Output is correct |
2 |
Correct |
468 ms |
10944 KB |
Output is correct |
3 |
Correct |
409 ms |
10084 KB |
Output is correct |
4 |
Correct |
307 ms |
13676 KB |
Output is correct |
5 |
Correct |
295 ms |
11628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
532 ms |
4956 KB |
Output is correct |
2 |
Correct |
612 ms |
14152 KB |
Output is correct |
3 |
Correct |
586 ms |
13808 KB |
Output is correct |
4 |
Correct |
364 ms |
16968 KB |
Output is correct |
5 |
Correct |
364 ms |
13100 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
607 ms |
4944 KB |
Output is correct |
2 |
Correct |
701 ms |
13128 KB |
Output is correct |
3 |
Correct |
489 ms |
11848 KB |
Output is correct |
4 |
Correct |
355 ms |
16756 KB |
Output is correct |
5 |
Correct |
349 ms |
13816 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
593 ms |
5912 KB |
Output is correct |
2 |
Correct |
720 ms |
16776 KB |
Output is correct |
3 |
Correct |
690 ms |
16004 KB |
Output is correct |
4 |
Correct |
433 ms |
19272 KB |
Output is correct |
5 |
Correct |
423 ms |
14720 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
711 ms |
5712 KB |
Output is correct |
2 |
Correct |
603 ms |
15148 KB |
Output is correct |
3 |
Correct |
584 ms |
14204 KB |
Output is correct |
4 |
Correct |
446 ms |
19204 KB |
Output is correct |
5 |
Correct |
413 ms |
15880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
693 ms |
6684 KB |
Output is correct |
2 |
Correct |
791 ms |
18960 KB |
Output is correct |
3 |
Execution timed out |
1072 ms |
18192 KB |
Time limit exceeded |
4 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
823 ms |
6480 KB |
Output is correct |
2 |
Correct |
676 ms |
17300 KB |
Output is correct |
3 |
Correct |
663 ms |
16200 KB |
Output is correct |
4 |
Correct |
493 ms |
22088 KB |
Output is correct |
5 |
Correct |
481 ms |
18248 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
845 ms |
8256 KB |
Output is correct |
2 |
Correct |
992 ms |
23624 KB |
Output is correct |
3 |
Correct |
979 ms |
22792 KB |
Output is correct |
4 |
Correct |
591 ms |
27208 KB |
Output is correct |
5 |
Correct |
601 ms |
21688 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
1044 ms |
8016 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |