# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
1042243 |
2024-08-02T17:26:55 Z |
sssamui |
Mobile (BOI12_mobile) |
C++17 |
|
663 ms |
35164 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 = 4e9;
int it = 45;
while (it--)
{
double m = (l + r) / 2;
stack<pair<double, double>> c;
for (int i = 0; i < n; i++) if (xy[i].second <= 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 |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 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 |
3 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
3 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
4 ms |
540 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
45 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
47 ms |
1628 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
50 ms |
1624 KB |
Output is correct |
2 |
Correct |
50 ms |
1628 KB |
Output is correct |
3 |
Correct |
45 ms |
1628 KB |
Output is correct |
4 |
Incorrect |
66 ms |
3924 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
60 ms |
1884 KB |
Output is correct |
2 |
Correct |
61 ms |
1880 KB |
Output is correct |
3 |
Correct |
56 ms |
1884 KB |
Output is correct |
4 |
Incorrect |
72 ms |
3920 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
66 ms |
2132 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
305 ms |
8280 KB |
Output is correct |
2 |
Correct |
334 ms |
8280 KB |
Output is correct |
3 |
Correct |
340 ms |
8284 KB |
Output is correct |
4 |
Incorrect |
320 ms |
8284 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
306 ms |
8284 KB |
Output is correct |
2 |
Incorrect |
303 ms |
8808 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
355 ms |
9820 KB |
Output is correct |
2 |
Correct |
369 ms |
9820 KB |
Output is correct |
3 |
Correct |
367 ms |
9820 KB |
Output is correct |
4 |
Incorrect |
454 ms |
9820 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
369 ms |
9816 KB |
Output is correct |
2 |
Incorrect |
376 ms |
10576 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
410 ms |
11356 KB |
Output is correct |
2 |
Correct |
443 ms |
11356 KB |
Output is correct |
3 |
Correct |
438 ms |
11352 KB |
Output is correct |
4 |
Incorrect |
460 ms |
11356 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
432 ms |
11356 KB |
Output is correct |
2 |
Incorrect |
429 ms |
12372 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
475 ms |
13144 KB |
Output is correct |
2 |
Correct |
503 ms |
12892 KB |
Output is correct |
3 |
Correct |
508 ms |
12888 KB |
Output is correct |
4 |
Incorrect |
539 ms |
12892 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
493 ms |
12888 KB |
Output is correct |
2 |
Incorrect |
520 ms |
13904 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
601 ms |
15960 KB |
Output is correct |
2 |
Correct |
630 ms |
15960 KB |
Output is correct |
3 |
Correct |
640 ms |
15964 KB |
Output is correct |
4 |
Incorrect |
663 ms |
35164 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
634 ms |
15964 KB |
Output is correct |
2 |
Incorrect |
606 ms |
17488 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |