# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1042247 |
2024-08-02T17:40:53 Z |
sssamui |
Mobile (BOI12_mobile) |
C++17 |
|
801 ms |
17492 KB |
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#include <iomanip>
using namespace std;
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
double L;
cin >> n >> L;
vector<pair<double, double>> xy(n);
for (int i = 0; i < n; i++) cin >> xy[i].first >> xy[i].second;
double l = 0, r = 1e9;
int it = 60;
while (it--)
{
double m = (l + r) / 2;
stack<pair<double, double>> c;
for (int i = 0; i < n; i++) if (xy[i].second * xy[i].second <= m * m)
{
double sq = sqrt(m * m - xy[i].second * xy[i].second);
double a = fmax(0, xy[i].first - sq), b = fmin(L, xy[i].first + sq);
while (!c.empty() && (c.top().second >= a))
{
a = fmin(a, c.top().first), b = fmax(b, c.top().second);
c.pop();
}
c.push({ a, b });
}
if ((c.size() != 1) || ((c.top().first > 0) || (c.top().second < L))) l = m;
else r = m;
}
cout << fixed << setprecision(3) << l;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
2 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
61 ms |
1640 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
57 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
63 ms |
1624 KB |
Output is correct |
2 |
Correct |
67 ms |
1624 KB |
Output is correct |
3 |
Correct |
52 ms |
1628 KB |
Output is correct |
4 |
Incorrect |
80 ms |
2024 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
87 ms |
1884 KB |
Output is correct |
2 |
Correct |
72 ms |
1884 KB |
Output is correct |
3 |
Correct |
62 ms |
1880 KB |
Output is correct |
4 |
Incorrect |
80 ms |
2136 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
104 ms |
2128 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
356 ms |
8280 KB |
Output is correct |
2 |
Correct |
377 ms |
8284 KB |
Output is correct |
3 |
Correct |
363 ms |
8284 KB |
Output is correct |
4 |
Incorrect |
390 ms |
8532 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
416 ms |
8284 KB |
Output is correct |
2 |
Incorrect |
367 ms |
8784 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
419 ms |
9820 KB |
Output is correct |
2 |
Correct |
445 ms |
9816 KB |
Output is correct |
3 |
Correct |
445 ms |
9816 KB |
Output is correct |
4 |
Incorrect |
460 ms |
10320 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
448 ms |
9820 KB |
Output is correct |
2 |
Incorrect |
447 ms |
10576 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
490 ms |
11356 KB |
Output is correct |
2 |
Correct |
518 ms |
11356 KB |
Output is correct |
3 |
Correct |
569 ms |
11356 KB |
Output is correct |
4 |
Incorrect |
561 ms |
12176 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
582 ms |
11356 KB |
Output is correct |
2 |
Incorrect |
537 ms |
12172 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
578 ms |
12892 KB |
Output is correct |
2 |
Correct |
617 ms |
12888 KB |
Output is correct |
3 |
Correct |
586 ms |
12892 KB |
Output is correct |
4 |
Incorrect |
625 ms |
14160 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
603 ms |
12892 KB |
Output is correct |
2 |
Incorrect |
608 ms |
13912 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
703 ms |
15960 KB |
Output is correct |
2 |
Correct |
731 ms |
15964 KB |
Output is correct |
3 |
Correct |
720 ms |
15964 KB |
Output is correct |
4 |
Incorrect |
801 ms |
17140 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
739 ms |
15960 KB |
Output is correct |
2 |
Incorrect |
753 ms |
17492 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |