Submission #1042249

# Submission time Handle Problem Language Result Execution time Memory
1042249 2024-08-02T17:42:16 Z sssamui Mobile (BOI12_mobile) C++17
0 / 100
803 ms 17488 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(6) << l;
}
# 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 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 548 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 56 ms 1628 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 59 ms 1624 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 60 ms 1624 KB Output is correct
2 Correct 64 ms 1624 KB Output is correct
3 Correct 52 ms 1628 KB Output is correct
4 Incorrect 79 ms 2132 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 96 ms 1884 KB Output is correct
2 Correct 76 ms 1884 KB Output is correct
3 Correct 62 ms 1884 KB Output is correct
4 Incorrect 77 ms 2128 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 82 ms 2024 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 353 ms 8284 KB Output is correct
2 Correct 367 ms 8280 KB Output is correct
3 Correct 370 ms 8280 KB Output is correct
4 Incorrect 379 ms 8532 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 375 ms 8280 KB Output is correct
2 Incorrect 392 ms 8796 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 418 ms 10072 KB Output is correct
2 Correct 461 ms 9820 KB Output is correct
3 Correct 443 ms 9820 KB Output is correct
4 Incorrect 468 ms 10324 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 474 ms 9816 KB Output is correct
2 Incorrect 436 ms 10604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 511 ms 11356 KB Output is correct
2 Correct 513 ms 11356 KB Output is correct
3 Correct 506 ms 11352 KB Output is correct
4 Incorrect 564 ms 12372 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 525 ms 11352 KB Output is correct
2 Incorrect 511 ms 12368 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 579 ms 12892 KB Output is correct
2 Correct 608 ms 13144 KB Output is correct
3 Correct 580 ms 12888 KB Output is correct
4 Incorrect 621 ms 14160 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 598 ms 12888 KB Output is correct
2 Incorrect 651 ms 13908 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 730 ms 15964 KB Output is correct
2 Correct 739 ms 15964 KB Output is correct
3 Correct 765 ms 15964 KB Output is correct
4 Incorrect 803 ms 17236 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 789 ms 15964 KB Output is correct
2 Incorrect 728 ms 17488 KB Output isn't correct
3 Halted 0 ms 0 KB -