Submission #1042244

# Submission time Handle Problem Language Result Execution time Memory
1042244 2024-08-02T17:31:02 Z sssamui Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 31580 KB
#include <iostream>
#include <cstdio>
#include <vector>
#include <cmath>
#include <stack>
#include <iomanip>
using namespace std;
using ld = long double;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n;
	ld L;
	cin >> n >> L;
	vector<pair<ld, ld>> xy(n);
	for (int i = 0; i < n; i++) cin >> xy[i].first >> xy[i].second;

	ld l = 0, r = 4e9;
	int it = 45;
	while (it--)
	{
		ld m = (l + r) / 2;
		stack<pair<ld, ld>> c;
		for (int i = 0; i < n; i++) if (xy[i].second <= m)
		{
			ld sq = sqrt(m * m - xy[i].second * xy[i].second);
			ld 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 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 12 ms 608 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 11 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 159 ms 2900 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 170 ms 2908 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 186 ms 3160 KB Output is correct
2 Correct 177 ms 2904 KB Output is correct
3 Correct 155 ms 2904 KB Output is correct
4 Incorrect 237 ms 3420 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 213 ms 3420 KB Output is correct
2 Correct 214 ms 3420 KB Output is correct
3 Correct 181 ms 3416 KB Output is correct
4 Incorrect 224 ms 3420 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 221 ms 4104 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1051 ms 16056 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1056 ms 15964 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 19036 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 19036 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1040 ms 22364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1067 ms 22364 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1064 ms 25436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1059 ms 25436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1055 ms 31580 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1054 ms 31580 KB Time limit exceeded
2 Halted 0 ms 0 KB -