Submission #654441

# Submission time Handle Problem Language Result Execution time Memory
654441 2022-10-31T10:02:20 Z yhussain11 Mobile (BOI12_mobile) C++17
100 / 100
407 ms 16000 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 1 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 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
2 Correct 1 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 2 ms 340 KB Output is correct
4 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 468 KB Output is correct
2 Correct 3 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 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 2 ms 340 KB Output is correct
4 Correct 4 ms 340 KB Output is correct
5 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 31 ms 1420 KB Output is correct
2 Correct 23 ms 1492 KB Output is correct
3 Correct 18 ms 1172 KB Output is correct
4 Correct 27 ms 1492 KB Output is correct
5 Correct 18 ms 1108 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 28 ms 1536 KB Output is correct
2 Correct 24 ms 1428 KB Output is correct
3 Correct 35 ms 1584 KB Output is correct
4 Correct 36 ms 1492 KB Output is correct
5 Correct 40 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 22 ms 1620 KB Output is correct
2 Correct 26 ms 1616 KB Output is correct
3 Correct 23 ms 1748 KB Output is correct
4 Correct 44 ms 1864 KB Output is correct
5 Correct 36 ms 1620 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 32 ms 1888 KB Output is correct
2 Correct 38 ms 1872 KB Output is correct
3 Correct 30 ms 1876 KB Output is correct
4 Correct 37 ms 1868 KB Output is correct
5 Correct 33 ms 1876 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 1824 KB Output is correct
2 Correct 30 ms 1896 KB Output is correct
3 Correct 26 ms 1880 KB Output is correct
4 Correct 37 ms 1872 KB Output is correct
5 Correct 47 ms 1872 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 119 ms 8136 KB Output is correct
2 Correct 183 ms 8136 KB Output is correct
3 Correct 142 ms 8084 KB Output is correct
4 Correct 177 ms 8132 KB Output is correct
5 Correct 165 ms 8052 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 160 ms 8256 KB Output is correct
2 Correct 216 ms 8220 KB Output is correct
3 Correct 131 ms 8108 KB Output is correct
4 Correct 183 ms 8196 KB Output is correct
5 Correct 179 ms 8144 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 149 ms 9708 KB Output is correct
2 Correct 173 ms 9784 KB Output is correct
3 Correct 166 ms 9588 KB Output is correct
4 Correct 277 ms 9724 KB Output is correct
5 Correct 206 ms 9708 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 177 ms 9656 KB Output is correct
2 Correct 263 ms 9692 KB Output is correct
3 Correct 160 ms 9764 KB Output is correct
4 Correct 217 ms 9676 KB Output is correct
5 Correct 226 ms 9672 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 218 ms 11140 KB Output is correct
2 Correct 202 ms 11184 KB Output is correct
3 Correct 204 ms 11268 KB Output is correct
4 Correct 263 ms 11328 KB Output is correct
5 Correct 268 ms 11268 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 206 ms 11252 KB Output is correct
2 Correct 300 ms 11248 KB Output is correct
3 Correct 191 ms 11236 KB Output is correct
4 Correct 267 ms 11232 KB Output is correct
5 Correct 237 ms 11240 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 189 ms 12776 KB Output is correct
2 Correct 240 ms 12884 KB Output is correct
3 Correct 263 ms 12844 KB Output is correct
4 Correct 300 ms 12964 KB Output is correct
5 Correct 268 ms 12796 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 242 ms 12836 KB Output is correct
2 Correct 341 ms 12792 KB Output is correct
3 Correct 249 ms 12836 KB Output is correct
4 Correct 291 ms 12844 KB Output is correct
5 Correct 259 ms 12828 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 294 ms 15964 KB Output is correct
2 Correct 282 ms 16000 KB Output is correct
3 Correct 297 ms 15852 KB Output is correct
4 Correct 377 ms 15912 KB Output is correct
5 Correct 335 ms 15888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 300 ms 15956 KB Output is correct
2 Correct 407 ms 15952 KB Output is correct
3 Correct 298 ms 15904 KB Output is correct
4 Correct 358 ms 15928 KB Output is correct
5 Correct 358 ms 15836 KB Output is correct