Submission #1023049

# Submission time Handle Problem Language Result Execution time Memory
1023049 2024-07-14T09:00:33 Z tkvinhtruongquang Mobile (BOI12_mobile) C++14
100 / 100
358 ms 34640 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;
    for(int i = 1; i <= 42; i ++) {
		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 344 KB Output is correct
2 Correct 0 ms 464 KB Output is correct
3 Correct 1 ms 600 KB Output is correct
4 Correct 1 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 0 ms 348 KB Output is correct
4 Correct 1 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 528 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 2 ms 344 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 3 ms 476 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 2 ms 600 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 600 KB Output is correct
5 Correct 2 ms 536 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 2392 KB Output is correct
2 Correct 21 ms 2652 KB Output is correct
3 Correct 15 ms 1884 KB Output is correct
4 Correct 32 ms 2652 KB Output is correct
5 Correct 14 ms 1640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 2396 KB Output is correct
2 Correct 25 ms 2140 KB Output is correct
3 Correct 27 ms 2504 KB Output is correct
4 Correct 26 ms 2652 KB Output is correct
5 Correct 34 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 2396 KB Output is correct
2 Correct 21 ms 2848 KB Output is correct
3 Correct 24 ms 2604 KB Output is correct
4 Correct 38 ms 3960 KB Output is correct
5 Correct 28 ms 2648 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 26 ms 3376 KB Output is correct
2 Correct 26 ms 3300 KB Output is correct
3 Correct 39 ms 3036 KB Output is correct
4 Correct 36 ms 3928 KB Output is correct
5 Correct 54 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 3348 KB Output is correct
2 Correct 31 ms 3492 KB Output is correct
3 Correct 25 ms 2904 KB Output is correct
4 Correct 38 ms 3932 KB Output is correct
5 Correct 35 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 109 ms 12372 KB Output is correct
2 Correct 134 ms 16056 KB Output is correct
3 Correct 123 ms 15440 KB Output is correct
4 Correct 174 ms 17744 KB Output is correct
5 Correct 176 ms 15180 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 125 ms 16464 KB Output is correct
2 Correct 194 ms 14712 KB Output is correct
3 Correct 119 ms 13904 KB Output is correct
4 Correct 185 ms 17488 KB Output is correct
5 Correct 152 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 134 ms 14932 KB Output is correct
2 Correct 196 ms 19280 KB Output is correct
3 Correct 145 ms 18180 KB Output is correct
4 Correct 213 ms 21292 KB Output is correct
5 Correct 191 ms 17744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 146 ms 19536 KB Output is correct
2 Correct 224 ms 17380 KB Output is correct
3 Correct 140 ms 16468 KB Output is correct
4 Correct 203 ms 21332 KB Output is correct
5 Correct 177 ms 18388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 150 ms 17232 KB Output is correct
2 Correct 175 ms 22096 KB Output is correct
3 Correct 174 ms 21328 KB Output is correct
4 Correct 241 ms 24344 KB Output is correct
5 Correct 252 ms 20304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 180 ms 22612 KB Output is correct
2 Correct 262 ms 20824 KB Output is correct
3 Correct 173 ms 19384 KB Output is correct
4 Correct 239 ms 24400 KB Output is correct
5 Correct 244 ms 21284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 178 ms 19796 KB Output is correct
2 Correct 197 ms 24912 KB Output is correct
3 Correct 200 ms 24260 KB Output is correct
4 Correct 322 ms 28244 KB Output is correct
5 Correct 264 ms 23896 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 205 ms 25660 KB Output is correct
2 Correct 298 ms 23412 KB Output is correct
3 Correct 205 ms 22212 KB Output is correct
4 Correct 284 ms 27988 KB Output is correct
5 Correct 265 ms 24524 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 237 ms 24344 KB Output is correct
2 Correct 313 ms 31464 KB Output is correct
3 Correct 241 ms 30036 KB Output is correct
4 Correct 358 ms 34516 KB Output is correct
5 Correct 328 ms 29008 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 263 ms 31828 KB Output is correct
2 Correct 342 ms 28752 KB Output is correct
3 Correct 283 ms 27640 KB Output is correct
4 Correct 336 ms 34640 KB Output is correct
5 Correct 300 ms 30292 KB Output is correct