답안 #906165

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
906165 2024-01-13T15:01:56 Z Nonoze Mobile (BOI12_mobile) C++17
52 / 100
284 ms 18356 KB
#include <bits/stdc++.h>
#define sz(x) (int)(x.size())

using namespace std;

int n, L;
vector<pair<double, double>> a;

void solve() {
	cin >> n >> L;
	a.clear();
	for (int i=0; i<n; i++) {
		int x, y; cin >> x >> y;
		if (!a.empty() && x==a.back().first) {
			if (abs(y)<abs(a.back().second)) a.back().second=y;
			continue;
		}
		a.push_back({x, y});
	}
	n=sz(a);
	double l=0, r=1e9;
	while (r-l>0.00095) {
		double mid=(l+r)/2;
		double borne=0;
		for (int i=0; i<n; i++) {
			if (abs(a[i].second)>mid) continue;
			double x=a[i].first, y=a[i].second;
			double dist=sqrt((double)(mid*mid-y*y));
			if (x-dist<=borne && x+dist>borne) borne=x+dist;
		}
		if (borne>=L) r=mid;
		else l=mid;
	}
	cout << fixed << setprecision(3) << l << endl;
	return;
}


signed main() {
	ios::sync_with_stdio(0);
	cin.tie(0);
	solve();
	return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 1 ms 344 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 1 ms 344 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 2 ms 600 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 2 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 600 KB Output is correct
2 Correct 2 ms 600 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
5 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2516 KB Output is correct
2 Correct 17 ms 1500 KB Output is correct
3 Correct 17 ms 1496 KB Output is correct
4 Correct 18 ms 2520 KB Output is correct
5 Correct 6 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 10 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2516 KB Output is correct
2 Correct 23 ms 1496 KB Output is correct
3 Correct 18 ms 2516 KB Output is correct
4 Correct 24 ms 2520 KB Output is correct
5 Correct 14 ms 992 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 19 ms 1552 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 2516 KB Output is correct
2 Correct 19 ms 1500 KB Output is correct
3 Incorrect 13 ms 736 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 10652 KB Output is correct
2 Correct 66 ms 600 KB Output is correct
3 Correct 64 ms 600 KB Output is correct
4 Incorrect 117 ms 10696 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 75 ms 596 KB Output is correct
2 Correct 157 ms 10468 KB Output is correct
3 Correct 67 ms 2508 KB Output is correct
4 Correct 119 ms 8656 KB Output is correct
5 Correct 102 ms 8904 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 136 ms 17340 KB Output is correct
2 Correct 109 ms 596 KB Output is correct
3 Correct 76 ms 848 KB Output is correct
4 Correct 141 ms 17788 KB Output is correct
5 Correct 107 ms 9652 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 80 ms 508 KB Output is correct
2 Correct 194 ms 17088 KB Output is correct
3 Correct 78 ms 2512 KB Output is correct
4 Correct 138 ms 17660 KB Output is correct
5 Correct 124 ms 17624 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 162 ms 17748 KB Output is correct
2 Correct 90 ms 644 KB Output is correct
3 Correct 90 ms 536 KB Output is correct
4 Incorrect 153 ms 18056 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 93 ms 544 KB Output is correct
2 Incorrect 206 ms 17044 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 189 ms 18212 KB Output is correct
2 Incorrect 105 ms 592 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 105 ms 556 KB Output is correct
2 Correct 233 ms 17808 KB Output is correct
3 Correct 102 ms 2512 KB Output is correct
4 Correct 181 ms 17948 KB Output is correct
5 Correct 164 ms 18356 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 232 ms 18164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 130 ms 592 KB Output is correct
2 Correct 284 ms 17624 KB Output is correct
3 Correct 134 ms 5848 KB Output is correct
4 Correct 230 ms 17844 KB Output is correct
5 Correct 205 ms 17332 KB Output is correct