답안 #1116511

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1116511 2024-11-21T18:26:42 Z vomanos Mobile (BOI12_mobile) C++14
100 / 100
824 ms 35412 KB
// Source: https://usaco.guide/general/io

#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define pdd pair<double, double>

double dist2(pdd a, pdd b) {
	return (a.first - b.first) * (a.first - b.first)
	+ (a.second - b.second) * (a.second - b.second);
}

int main() {
	int N;
	ll L;
	cin >> N >> L;

	pdd s[N];
	for (int i = 0; i < N; i++) cin >> s[i].first >> s[i].second;

	double low = 0, high = 1e12;
	// double low = 6, high = 6.01;
	while (high - low > 0.000001) {
		double mid = low + (high - low) / 2;

		double x = 0;
		for (int i = 0; i < N; i++) {
			if (dist2({x, 0}, {s[i]}) > mid*mid) continue;

			// let x = s[i].first, y = s[i].second;
			// (x + d)^2 + y^2 = r^2
			// x + d = sqrt(r^2 - y^2)
			//d = sqrt(r^2 - y^2)

			x = s[i].first + sqrt(mid*mid - s[i].second * s[i].second);
		}

		// cout << mid << " " << x << endl;

		if (x >= L) high = mid;
		else low = mid;
	}

	cout << fixed << setprecision(10) << high;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 336 KB Output is correct
2 Correct 1 ms 440 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 504 KB Output is correct
2 Correct 1 ms 508 KB Output is correct
3 Correct 1 ms 336 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 336 KB Output is correct
2 Correct 2 ms 496 KB Output is correct
3 Correct 2 ms 620 KB Output is correct
4 Correct 3 ms 504 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 6 ms 508 KB Output is correct
2 Correct 4 ms 504 KB Output is correct
3 Correct 3 ms 556 KB Output is correct
4 Correct 5 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 336 KB Output is correct
2 Correct 5 ms 580 KB Output is correct
3 Correct 3 ms 336 KB Output is correct
4 Correct 5 ms 592 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 4 ms 336 KB Output is correct
2 Correct 4 ms 336 KB Output is correct
3 Correct 3 ms 336 KB Output is correct
4 Correct 5 ms 592 KB Output is correct
5 Correct 4 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 57 ms 1360 KB Output is correct
2 Correct 54 ms 2632 KB Output is correct
3 Correct 35 ms 1836 KB Output is correct
4 Correct 58 ms 2632 KB Output is correct
5 Correct 28 ms 1752 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 49 ms 2128 KB Output is correct
2 Correct 55 ms 2272 KB Output is correct
3 Correct 59 ms 2696 KB Output is correct
4 Correct 61 ms 2640 KB Output is correct
5 Correct 85 ms 3044 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 54 ms 1616 KB Output is correct
2 Correct 59 ms 2656 KB Output is correct
3 Correct 54 ms 2508 KB Output is correct
4 Correct 88 ms 3880 KB Output is correct
5 Correct 68 ms 2696 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 81 ms 1996 KB Output is correct
2 Correct 74 ms 3148 KB Output is correct
3 Correct 60 ms 2888 KB Output is correct
4 Correct 85 ms 3900 KB Output is correct
5 Correct 75 ms 2996 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 75 ms 2040 KB Output is correct
2 Correct 76 ms 3408 KB Output is correct
3 Correct 57 ms 2888 KB Output is correct
4 Correct 83 ms 3760 KB Output is correct
5 Correct 75 ms 3128 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 312 ms 8012 KB Output is correct
2 Correct 336 ms 15944 KB Output is correct
3 Correct 324 ms 15432 KB Output is correct
4 Correct 401 ms 17736 KB Output is correct
5 Correct 373 ms 14884 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 353 ms 8016 KB Output is correct
2 Correct 374 ms 14676 KB Output is correct
3 Correct 314 ms 14152 KB Output is correct
4 Correct 390 ms 17456 KB Output is correct
5 Correct 367 ms 15688 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 372 ms 9976 KB Output is correct
2 Correct 406 ms 19016 KB Output is correct
3 Correct 393 ms 18504 KB Output is correct
4 Correct 510 ms 21572 KB Output is correct
5 Correct 439 ms 17788 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 425 ms 14920 KB Output is correct
2 Correct 446 ms 17736 KB Output is correct
3 Correct 352 ms 16632 KB Output is correct
4 Correct 481 ms 21316 KB Output is correct
5 Correct 462 ms 18368 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 450 ms 14664 KB Output is correct
2 Correct 470 ms 22088 KB Output is correct
3 Correct 481 ms 21476 KB Output is correct
4 Correct 599 ms 24808 KB Output is correct
5 Correct 564 ms 20320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 523 ms 11344 KB Output is correct
2 Correct 521 ms 20552 KB Output is correct
3 Correct 428 ms 19528 KB Output is correct
4 Correct 578 ms 24648 KB Output is correct
5 Correct 521 ms 21320 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 524 ms 18568 KB Output is correct
2 Correct 562 ms 25160 KB Output is correct
3 Correct 534 ms 24392 KB Output is correct
4 Correct 634 ms 28488 KB Output is correct
5 Correct 609 ms 23940 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 574 ms 12888 KB Output is correct
2 Correct 624 ms 23296 KB Output is correct
3 Correct 484 ms 22412 KB Output is correct
4 Correct 650 ms 28288 KB Output is correct
5 Correct 591 ms 24392 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 634 ms 22860 KB Output is correct
2 Correct 689 ms 31560 KB Output is correct
3 Correct 667 ms 30392 KB Output is correct
4 Correct 804 ms 35256 KB Output is correct
5 Correct 742 ms 29512 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 700 ms 16068 KB Output is correct
2 Correct 769 ms 29244 KB Output is correct
3 Correct 617 ms 28344 KB Output is correct
4 Correct 824 ms 35412 KB Output is correct
5 Correct 742 ms 30792 KB Output is correct