Submission #470014

# Submission time Handle Problem Language Result Execution time Memory
470014 2021-09-02T15:13:22 Z Shogun3103 Mobile (BOI12_mobile) C++17
100 / 100
524 ms 24628 KB
#include <bits/stdc++.h>
#define x first
#define y second
using namespace std;

pair<long long, long long> p[1000000];

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, len;
	cin >> n >> len;
	for (int i = 0; i < n; i++) cin >> p[i].x >> p[i].y;

	double l = 1, r = 1.5e9;
	while (r - l > 1e-3) {
		double mid = (l + r) / 2, curr = 0;
		for (int i = 0; i < n; i++) {
			double delta = sqrt(mid * mid - p[i].y * p[i].y);
			double a = p[i].x - delta, b = p[i].x + delta;
			if (a <= curr) curr = max(curr, b);
		}

		if (curr >= len) r = mid;
		else l = mid;
	}

	cout << fixed << setprecision(4) << l;
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 332 KB Output is correct
2 Correct 2 ms 336 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 3 ms 464 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 3 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB Output is correct
2 Correct 3 ms 332 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 3 ms 460 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 1596 KB Output is correct
2 Correct 31 ms 1656 KB Output is correct
3 Correct 21 ms 1284 KB Output is correct
4 Correct 51 ms 1564 KB Output is correct
5 Correct 21 ms 1228 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 35 ms 1584 KB Output is correct
2 Correct 32 ms 1532 KB Output is correct
3 Correct 37 ms 1732 KB Output is correct
4 Correct 39 ms 1732 KB Output is correct
5 Correct 43 ms 2000 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 1848 KB Output is correct
2 Correct 34 ms 1732 KB Output is correct
3 Correct 33 ms 1736 KB Output is correct
4 Correct 52 ms 2116 KB Output is correct
5 Correct 40 ms 1768 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 1996 KB Output is correct
2 Correct 40 ms 1996 KB Output is correct
3 Correct 39 ms 2024 KB Output is correct
4 Correct 52 ms 2128 KB Output is correct
5 Correct 46 ms 1984 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 41 ms 2044 KB Output is correct
2 Correct 41 ms 2024 KB Output is correct
3 Correct 39 ms 2032 KB Output is correct
4 Correct 54 ms 2240 KB Output is correct
5 Correct 53 ms 2120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 181 ms 8388 KB Output is correct
2 Correct 216 ms 8204 KB Output is correct
3 Correct 206 ms 8516 KB Output is correct
4 Correct 256 ms 8396 KB Output is correct
5 Correct 233 ms 8460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 208 ms 8288 KB Output is correct
2 Correct 271 ms 8388 KB Output is correct
3 Correct 198 ms 8440 KB Output is correct
4 Correct 259 ms 8420 KB Output is correct
5 Correct 238 ms 8424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 217 ms 9796 KB Output is correct
2 Correct 248 ms 9796 KB Output is correct
3 Correct 246 ms 10128 KB Output is correct
4 Correct 316 ms 10048 KB Output is correct
5 Correct 276 ms 10052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 249 ms 9852 KB Output is correct
2 Correct 352 ms 9968 KB Output is correct
3 Correct 234 ms 9956 KB Output is correct
4 Correct 328 ms 10092 KB Output is correct
5 Correct 285 ms 10140 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 262 ms 11400 KB Output is correct
2 Correct 290 ms 11468 KB Output is correct
3 Correct 284 ms 11588 KB Output is correct
4 Correct 363 ms 11532 KB Output is correct
5 Correct 326 ms 11524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 296 ms 11424 KB Output is correct
2 Correct 372 ms 11636 KB Output is correct
3 Correct 281 ms 11676 KB Output is correct
4 Correct 356 ms 11632 KB Output is correct
5 Correct 331 ms 11524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 299 ms 12868 KB Output is correct
2 Correct 327 ms 13064 KB Output is correct
3 Correct 328 ms 13124 KB Output is correct
4 Correct 409 ms 13240 KB Output is correct
5 Correct 376 ms 13120 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 331 ms 12996 KB Output is correct
2 Correct 425 ms 13132 KB Output is correct
3 Correct 322 ms 13252 KB Output is correct
4 Correct 411 ms 13208 KB Output is correct
5 Correct 380 ms 13276 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 369 ms 16188 KB Output is correct
2 Correct 421 ms 16220 KB Output is correct
3 Correct 413 ms 16196 KB Output is correct
4 Correct 521 ms 16180 KB Output is correct
5 Correct 478 ms 24628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 414 ms 15940 KB Output is correct
2 Correct 524 ms 16324 KB Output is correct
3 Correct 403 ms 15940 KB Output is correct
4 Correct 523 ms 15976 KB Output is correct
5 Correct 493 ms 24628 KB Output is correct