Submission #670281

# Submission time Handle Problem Language Result Execution time Memory
670281 2022-12-08T14:38:31 Z RadicaI Mobile (BOI12_mobile) C++17
100 / 100
392 ms 35276 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 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 0 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 340 KB Output is correct
2 Correct 1 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 2 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1492 KB Output is correct
2 Correct 23 ms 1576 KB Output is correct
3 Correct 20 ms 1168 KB Output is correct
4 Correct 36 ms 1384 KB Output is correct
5 Correct 13 ms 1112 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 21 ms 1492 KB Output is correct
2 Correct 21 ms 1364 KB Output is correct
3 Correct 25 ms 1604 KB Output is correct
4 Correct 26 ms 1552 KB Output is correct
5 Correct 30 ms 1680 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 19 ms 1704 KB Output is correct
2 Correct 22 ms 1528 KB Output is correct
3 Correct 21 ms 1560 KB Output is correct
4 Correct 35 ms 1860 KB Output is correct
5 Correct 29 ms 1700 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1872 KB Output is correct
2 Correct 29 ms 3204 KB Output is correct
3 Correct 26 ms 2792 KB Output is correct
4 Correct 37 ms 3728 KB Output is correct
5 Correct 32 ms 3128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1876 KB Output is correct
2 Correct 27 ms 1892 KB Output is correct
3 Correct 26 ms 1832 KB Output is correct
4 Correct 36 ms 1832 KB Output is correct
5 Correct 31 ms 1796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 113 ms 8132 KB Output is correct
2 Correct 136 ms 8052 KB Output is correct
3 Correct 145 ms 15260 KB Output is correct
4 Correct 183 ms 17620 KB Output is correct
5 Correct 162 ms 15052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 143 ms 8136 KB Output is correct
2 Correct 204 ms 8132 KB Output is correct
3 Correct 126 ms 8012 KB Output is correct
4 Correct 173 ms 8012 KB Output is correct
5 Correct 154 ms 8048 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 139 ms 9648 KB Output is correct
2 Correct 173 ms 9708 KB Output is correct
3 Correct 173 ms 18404 KB Output is correct
4 Correct 217 ms 21580 KB Output is correct
5 Correct 187 ms 17568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 166 ms 9676 KB Output is correct
2 Correct 257 ms 17620 KB Output is correct
3 Correct 162 ms 16480 KB Output is correct
4 Correct 218 ms 21500 KB Output is correct
5 Correct 208 ms 18416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 163 ms 11252 KB Output is correct
2 Correct 191 ms 11264 KB Output is correct
3 Correct 192 ms 21448 KB Output is correct
4 Correct 261 ms 24848 KB Output is correct
5 Correct 227 ms 20196 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 193 ms 11228 KB Output is correct
2 Correct 274 ms 11220 KB Output is correct
3 Correct 178 ms 11168 KB Output is correct
4 Correct 249 ms 11336 KB Output is correct
5 Correct 217 ms 11268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 179 ms 12836 KB Output is correct
2 Correct 222 ms 12720 KB Output is correct
3 Correct 223 ms 24384 KB Output is correct
4 Correct 291 ms 28464 KB Output is correct
5 Correct 257 ms 23980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 230 ms 12748 KB Output is correct
2 Correct 317 ms 23500 KB Output is correct
3 Correct 212 ms 22384 KB Output is correct
4 Correct 289 ms 28172 KB Output is correct
5 Correct 258 ms 24396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 221 ms 15928 KB Output is correct
2 Correct 278 ms 15844 KB Output is correct
3 Correct 276 ms 30492 KB Output is correct
4 Correct 371 ms 35148 KB Output is correct
5 Correct 325 ms 29512 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 279 ms 15908 KB Output is correct
2 Correct 392 ms 29076 KB Output is correct
3 Correct 271 ms 28236 KB Output is correct
4 Correct 368 ms 35276 KB Output is correct
5 Correct 333 ms 30688 KB Output is correct