Submission #1023045

# Submission time Handle Problem Language Result Execution time Memory
1023045 2024-07-14T08:57:11 Z tkvinhtruongquang Mobile (BOI12_mobile) C++14
100 / 100
445 ms 35408 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 <= 50; 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 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 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 0 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 508 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 1 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 476 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 3 ms 604 KB Output is correct
3 Correct 2 ms 724 KB Output is correct
4 Correct 2 ms 584 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 344 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
5 Correct 2 ms 532 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 43 ms 2236 KB Output is correct
2 Correct 24 ms 2628 KB Output is correct
3 Correct 19 ms 1880 KB Output is correct
4 Correct 49 ms 2652 KB Output is correct
5 Correct 21 ms 1624 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 2392 KB Output is correct
2 Correct 25 ms 2136 KB Output is correct
3 Correct 48 ms 2652 KB Output is correct
4 Correct 38 ms 2820 KB Output is correct
5 Correct 56 ms 3156 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 2396 KB Output is correct
2 Correct 32 ms 2648 KB Output is correct
3 Correct 34 ms 2648 KB Output is correct
4 Correct 37 ms 3932 KB Output is correct
5 Correct 42 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 3508 KB Output is correct
2 Correct 27 ms 3416 KB Output is correct
3 Correct 26 ms 2904 KB Output is correct
4 Correct 37 ms 3932 KB Output is correct
5 Correct 47 ms 3184 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 38 ms 3420 KB Output is correct
2 Correct 36 ms 3372 KB Output is correct
3 Correct 27 ms 3048 KB Output is correct
4 Correct 69 ms 3928 KB Output is correct
5 Correct 33 ms 3272 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 130 ms 12372 KB Output is correct
2 Correct 151 ms 15884 KB Output is correct
3 Correct 141 ms 15248 KB Output is correct
4 Correct 216 ms 17720 KB Output is correct
5 Correct 192 ms 14904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 160 ms 16472 KB Output is correct
2 Correct 247 ms 14796 KB Output is correct
3 Correct 138 ms 13876 KB Output is correct
4 Correct 199 ms 17592 KB Output is correct
5 Correct 166 ms 15504 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 148 ms 14832 KB Output is correct
2 Correct 159 ms 18988 KB Output is correct
3 Correct 157 ms 18396 KB Output is correct
4 Correct 232 ms 21712 KB Output is correct
5 Correct 227 ms 17704 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 160 ms 19532 KB Output is correct
2 Correct 274 ms 17748 KB Output is correct
3 Correct 199 ms 16468 KB Output is correct
4 Correct 223 ms 21584 KB Output is correct
5 Correct 202 ms 18468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 167 ms 17236 KB Output is correct
2 Correct 219 ms 22180 KB Output is correct
3 Correct 181 ms 21340 KB Output is correct
4 Correct 267 ms 24908 KB Output is correct
5 Correct 326 ms 20424 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 206 ms 22864 KB Output is correct
2 Correct 320 ms 20860 KB Output is correct
3 Correct 226 ms 19540 KB Output is correct
4 Correct 265 ms 24536 KB Output is correct
5 Correct 282 ms 21328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 231 ms 19892 KB Output is correct
2 Correct 227 ms 25172 KB Output is correct
3 Correct 218 ms 24576 KB Output is correct
4 Correct 319 ms 28500 KB Output is correct
5 Correct 277 ms 24108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 228 ms 25936 KB Output is correct
2 Correct 365 ms 23380 KB Output is correct
3 Correct 244 ms 22352 KB Output is correct
4 Correct 303 ms 28240 KB Output is correct
5 Correct 279 ms 24400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 272 ms 24596 KB Output is correct
2 Correct 309 ms 31572 KB Output is correct
3 Correct 267 ms 30660 KB Output is correct
4 Correct 381 ms 35156 KB Output is correct
5 Correct 344 ms 29560 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 289 ms 32340 KB Output is correct
2 Correct 445 ms 29264 KB Output is correct
3 Correct 283 ms 28244 KB Output is correct
4 Correct 383 ms 35408 KB Output is correct
5 Correct 362 ms 30804 KB Output is correct