Submission #906163

# Submission time Handle Problem Language Result Execution time Memory
906163 2024-01-13T15:00:50 Z Nonoze Mobile (BOI12_mobile) C++17
52 / 100
298 ms 18932 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.001) {
		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;
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory Grader output
1 Correct 0 ms 420 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 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
# 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 Correct 2 ms 604 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
5 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 2516 KB Output is correct
2 Correct 19 ms 1500 KB Output is correct
3 Correct 15 ms 1496 KB Output is correct
4 Correct 18 ms 2520 KB Output is correct
5 Correct 5 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 21 ms 2592 KB Output is correct
2 Correct 18 ms 1500 KB Output is correct
3 Correct 19 ms 2516 KB Output is correct
4 Correct 26 ms 2520 KB Output is correct
5 Correct 13 ms 992 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 19 ms 1604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 26 ms 2648 KB Output is correct
2 Correct 20 ms 1496 KB Output is correct
3 Incorrect 13 ms 736 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 116 ms 8656 KB Output is correct
2 Correct 71 ms 672 KB Output is correct
3 Correct 63 ms 824 KB Output is correct
4 Incorrect 118 ms 8892 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 72 ms 1116 KB Output is correct
2 Correct 170 ms 9608 KB Output is correct
3 Correct 69 ms 2512 KB Output is correct
4 Correct 108 ms 10156 KB Output is correct
5 Correct 101 ms 8808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 148 ms 17836 KB Output is correct
2 Correct 83 ms 544 KB Output is correct
3 Correct 100 ms 596 KB Output is correct
4 Correct 142 ms 18676 KB Output is correct
5 Correct 109 ms 9232 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 84 ms 564 KB Output is correct
2 Correct 196 ms 18028 KB Output is correct
3 Correct 76 ms 2440 KB Output is correct
4 Correct 142 ms 17124 KB Output is correct
5 Correct 143 ms 18580 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 210 ms 18740 KB Output is correct
2 Correct 114 ms 556 KB Output is correct
3 Correct 90 ms 580 KB Output is correct
4 Incorrect 165 ms 18636 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 94 ms 564 KB Output is correct
2 Incorrect 247 ms 18568 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 189 ms 16828 KB Output is correct
2 Incorrect 101 ms 596 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 107 ms 544 KB Output is correct
2 Correct 271 ms 18348 KB Output is correct
3 Correct 103 ms 2516 KB Output is correct
4 Correct 223 ms 17832 KB Output is correct
5 Correct 170 ms 17844 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 246 ms 18312 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 134 ms 492 KB Output is correct
2 Correct 298 ms 17564 KB Output is correct
3 Correct 159 ms 5636 KB Output is correct
4 Correct 233 ms 18932 KB Output is correct
5 Correct 235 ms 16824 KB Output is correct