답안 #1042242

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1042242 2024-08-02T17:25:43 Z sssamui Mobile (BOI12_mobile) C++17
0 / 100
716 ms 32620 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++)
		{
			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;
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 716 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 49 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 47 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 50 ms 2460 KB Output is correct
2 Correct 52 ms 2904 KB Output is correct
3 Incorrect 65 ms 2652 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 63 ms 3420 KB Output is correct
2 Correct 59 ms 3420 KB Output is correct
3 Incorrect 66 ms 2908 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 61 ms 3668 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 292 ms 12368 KB Output is correct
2 Correct 311 ms 15880 KB Output is correct
3 Correct 302 ms 15332 KB Output is correct
4 Incorrect 321 ms 17628 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 300 ms 16356 KB Output is correct
2 Incorrect 299 ms 15432 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 332 ms 14932 KB Output is correct
2 Correct 378 ms 19284 KB Output is correct
3 Correct 349 ms 18516 KB Output is correct
4 Incorrect 471 ms 21480 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 367 ms 19696 KB Output is correct
2 Incorrect 382 ms 18420 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 411 ms 17236 KB Output is correct
2 Correct 420 ms 22100 KB Output is correct
3 Correct 430 ms 21380 KB Output is correct
4 Incorrect 467 ms 24720 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 427 ms 22916 KB Output is correct
2 Incorrect 420 ms 21588 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 451 ms 19892 KB Output is correct
2 Correct 508 ms 25168 KB Output is correct
3 Correct 469 ms 24400 KB Output is correct
4 Incorrect 532 ms 28500 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 491 ms 25936 KB Output is correct
2 Incorrect 493 ms 24656 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 604 ms 24660 KB Output is correct
2 Correct 600 ms 31572 KB Output is correct
3 Incorrect 716 ms 30544 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 632 ms 32620 KB Output is correct
2 Incorrect 599 ms 30548 KB Output isn't correct
3 Halted 0 ms 0 KB -