Submission #1022989

# Submission time Handle Problem Language Result Execution time Memory
1022989 2024-07-14T08:28:37 Z tkvinhtruongquang Mobile (BOI12_mobile) C++14
100 / 100
343 ms 35532 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 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 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 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 580 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 476 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 544 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 536 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 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 2396 KB Output is correct
2 Correct 20 ms 2652 KB Output is correct
3 Correct 13 ms 1880 KB Output is correct
4 Correct 25 ms 2652 KB Output is correct
5 Correct 12 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 2392 KB Output is correct
2 Correct 19 ms 2136 KB Output is correct
3 Correct 23 ms 2652 KB Output is correct
4 Correct 23 ms 2796 KB Output is correct
5 Correct 27 ms 3292 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 2396 KB Output is correct
2 Correct 20 ms 2816 KB Output is correct
3 Correct 21 ms 2556 KB Output is correct
4 Correct 32 ms 3960 KB Output is correct
5 Correct 24 ms 2904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 25 ms 3420 KB Output is correct
2 Correct 25 ms 3412 KB Output is correct
3 Correct 23 ms 3052 KB Output is correct
4 Correct 34 ms 3988 KB Output is correct
5 Correct 29 ms 3160 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3408 KB Output is correct
2 Correct 25 ms 3416 KB Output is correct
3 Correct 23 ms 2908 KB Output is correct
4 Correct 35 ms 3872 KB Output is correct
5 Correct 28 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 107 ms 12380 KB Output is correct
2 Correct 123 ms 15780 KB Output is correct
3 Correct 126 ms 15444 KB Output is correct
4 Correct 154 ms 17744 KB Output is correct
5 Correct 144 ms 14924 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 128 ms 16460 KB Output is correct
2 Correct 192 ms 14676 KB Output is correct
3 Correct 137 ms 13904 KB Output is correct
4 Correct 155 ms 17488 KB Output is correct
5 Correct 151 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 144 ms 14932 KB Output is correct
2 Correct 151 ms 18956 KB Output is correct
3 Correct 148 ms 18768 KB Output is correct
4 Correct 219 ms 21732 KB Output is correct
5 Correct 184 ms 17940 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 158 ms 19792 KB Output is correct
2 Correct 231 ms 17600 KB Output is correct
3 Correct 143 ms 16468 KB Output is correct
4 Correct 200 ms 21396 KB Output is correct
5 Correct 173 ms 18512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 153 ms 17232 KB Output is correct
2 Correct 179 ms 22352 KB Output is correct
3 Correct 171 ms 21572 KB Output is correct
4 Correct 222 ms 24904 KB Output is correct
5 Correct 195 ms 20308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 184 ms 22708 KB Output is correct
2 Correct 256 ms 20560 KB Output is correct
3 Correct 174 ms 19796 KB Output is correct
4 Correct 227 ms 24696 KB Output is correct
5 Correct 240 ms 21404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 20052 KB Output is correct
2 Correct 202 ms 25304 KB Output is correct
3 Correct 195 ms 24508 KB Output is correct
4 Correct 254 ms 28484 KB Output is correct
5 Correct 230 ms 23892 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 210 ms 26196 KB Output is correct
2 Correct 281 ms 23376 KB Output is correct
3 Correct 187 ms 22352 KB Output is correct
4 Correct 266 ms 28496 KB Output is correct
5 Correct 223 ms 24396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 256 ms 24656 KB Output is correct
2 Correct 249 ms 31572 KB Output is correct
3 Correct 244 ms 30548 KB Output is correct
4 Correct 323 ms 35308 KB Output is correct
5 Correct 296 ms 29520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 258 ms 32592 KB Output is correct
2 Correct 343 ms 29264 KB Output is correct
3 Correct 236 ms 28240 KB Output is correct
4 Correct 317 ms 35532 KB Output is correct
5 Correct 290 ms 30964 KB Output is correct