답안 #906152

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
906152 2024-01-13T14:53:25 Z Nonoze Mobile (BOI12_mobile) C++17
100 / 100
298 ms 18948 KB
#include <bits/stdc++.h>

#define int long long
#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.0005) {
		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 348 KB Output is correct
2 Correct 0 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 0 ms 348 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 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 3 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 1 ms 344 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 24 ms 1496 KB Output is correct
3 Correct 13 ms 1500 KB Output is correct
4 Correct 18 ms 2616 KB Output is correct
5 Correct 5 ms 344 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 604 KB Output is correct
2 Correct 14 ms 1500 KB Output is correct
3 Correct 18 ms 2516 KB Output is correct
4 Correct 18 ms 2520 KB Output is correct
5 Correct 21 ms 2520 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 19 ms 2520 KB Output is correct
4 Correct 23 ms 2516 KB Output is correct
5 Correct 16 ms 988 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 19 ms 1500 KB Output is correct
2 Correct 18 ms 1500 KB Output is correct
3 Correct 14 ms 736 KB Output is correct
4 Correct 23 ms 2516 KB Output is correct
5 Correct 20 ms 2520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 29 ms 2564 KB Output is correct
2 Correct 18 ms 1496 KB Output is correct
3 Correct 13 ms 736 KB Output is correct
4 Correct 27 ms 2520 KB Output is correct
5 Correct 21 ms 2472 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 116 ms 9520 KB Output is correct
2 Correct 65 ms 656 KB Output is correct
3 Correct 65 ms 596 KB Output is correct
4 Correct 122 ms 9504 KB Output is correct
5 Correct 96 ms 10768 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 67 ms 716 KB Output is correct
2 Correct 169 ms 10392 KB Output is correct
3 Correct 69 ms 2512 KB Output is correct
4 Correct 108 ms 10432 KB Output is correct
5 Correct 103 ms 9956 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 145 ms 17844 KB Output is correct
2 Correct 80 ms 636 KB Output is correct
3 Correct 76 ms 596 KB Output is correct
4 Correct 136 ms 18104 KB Output is correct
5 Correct 112 ms 8708 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 91 ms 644 KB Output is correct
2 Correct 194 ms 17752 KB Output is correct
3 Correct 74 ms 2512 KB Output is correct
4 Correct 159 ms 18904 KB Output is correct
5 Correct 187 ms 17772 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 188 ms 18948 KB Output is correct
2 Correct 100 ms 604 KB Output is correct
3 Correct 85 ms 592 KB Output is correct
4 Correct 174 ms 17232 KB Output is correct
5 Correct 145 ms 10172 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 92 ms 552 KB Output is correct
2 Correct 221 ms 18680 KB Output is correct
3 Correct 102 ms 2596 KB Output is correct
4 Correct 171 ms 18700 KB Output is correct
5 Correct 150 ms 17316 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 209 ms 18240 KB Output is correct
2 Correct 102 ms 552 KB Output is correct
3 Correct 98 ms 540 KB Output is correct
4 Correct 184 ms 17956 KB Output is correct
5 Correct 149 ms 9152 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 109 ms 592 KB Output is correct
2 Correct 240 ms 18600 KB Output is correct
3 Correct 103 ms 2508 KB Output is correct
4 Correct 238 ms 17840 KB Output is correct
5 Correct 162 ms 17848 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 247 ms 17372 KB Output is correct
2 Correct 133 ms 492 KB Output is correct
3 Correct 125 ms 496 KB Output is correct
4 Correct 243 ms 17164 KB Output is correct
5 Correct 181 ms 9920 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 147 ms 592 KB Output is correct
2 Correct 298 ms 17308 KB Output is correct
3 Correct 130 ms 5316 KB Output is correct
4 Correct 256 ms 17668 KB Output is correct
5 Correct 251 ms 18136 KB Output is correct