Submission #1066374

# Submission time Handle Problem Language Result Execution time Memory
1066374 2024-08-19T19:24:21 Z JohnnyVenturas Mobile (BOI12_mobile) C++17
100 / 100
358 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;
	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 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 0 ms 600 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 344 KB Output is correct
2 Correct 1 ms 344 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 1 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 2 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 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 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 544 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 2896 KB Output is correct
2 Correct 18 ms 2648 KB Output is correct
3 Correct 15 ms 3164 KB Output is correct
4 Correct 25 ms 3680 KB Output is correct
5 Correct 12 ms 2904 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 2652 KB Output is correct
2 Correct 19 ms 2652 KB Output is correct
3 Correct 22 ms 2904 KB Output is correct
4 Correct 29 ms 3932 KB Output is correct
5 Correct 26 ms 4092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 2692 KB Output is correct
2 Correct 19 ms 2700 KB Output is correct
3 Correct 20 ms 3652 KB Output is correct
4 Correct 32 ms 4444 KB Output is correct
5 Correct 25 ms 3420 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 2648 KB Output is correct
2 Correct 23 ms 2700 KB Output is correct
3 Correct 23 ms 3724 KB Output is correct
4 Correct 32 ms 4444 KB Output is correct
5 Correct 27 ms 3932 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 2648 KB Output is correct
2 Correct 23 ms 2696 KB Output is correct
3 Correct 22 ms 3676 KB Output is correct
4 Correct 31 ms 4444 KB Output is correct
5 Correct 27 ms 3948 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 100 ms 8792 KB Output is correct
2 Correct 117 ms 8828 KB Output is correct
3 Correct 130 ms 16000 KB Output is correct
4 Correct 149 ms 18288 KB Output is correct
5 Correct 135 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 141 ms 8788 KB Output is correct
2 Correct 184 ms 15444 KB Output is correct
3 Correct 114 ms 14448 KB Output is correct
4 Correct 163 ms 18168 KB Output is correct
5 Correct 136 ms 16116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 123 ms 10880 KB Output is correct
2 Correct 138 ms 10836 KB Output is correct
3 Correct 148 ms 19448 KB Output is correct
4 Correct 189 ms 22648 KB Output is correct
5 Correct 162 ms 18804 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 147 ms 10836 KB Output is correct
2 Correct 219 ms 18768 KB Output is correct
3 Correct 131 ms 17524 KB Output is correct
4 Correct 230 ms 22632 KB Output is correct
5 Correct 169 ms 19440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 142 ms 12684 KB Output is correct
2 Correct 160 ms 13140 KB Output is correct
3 Correct 164 ms 22864 KB Output is correct
4 Correct 210 ms 24936 KB Output is correct
5 Correct 188 ms 20308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 184 ms 11380 KB Output is correct
2 Correct 248 ms 20564 KB Output is correct
3 Correct 161 ms 19788 KB Output is correct
4 Correct 217 ms 24656 KB Output is correct
5 Correct 192 ms 21360 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 167 ms 12880 KB Output is correct
2 Correct 195 ms 12884 KB Output is correct
3 Correct 188 ms 24408 KB Output is correct
4 Correct 242 ms 28556 KB Output is correct
5 Correct 218 ms 24060 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 188 ms 12884 KB Output is correct
2 Correct 280 ms 25428 KB Output is correct
3 Correct 189 ms 24400 KB Output is correct
4 Correct 258 ms 30316 KB Output is correct
5 Correct 253 ms 26356 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 216 ms 15956 KB Output is correct
2 Correct 235 ms 15996 KB Output is correct
3 Correct 236 ms 30808 KB Output is correct
4 Correct 309 ms 35340 KB Output is correct
5 Correct 284 ms 29512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 235 ms 15952 KB Output is correct
2 Correct 358 ms 29268 KB Output is correct
3 Correct 233 ms 28244 KB Output is correct
4 Correct 308 ms 35408 KB Output is correct
5 Correct 283 ms 30840 KB Output is correct