Submission #964130

# Submission time Handle Problem Language Result Execution time Memory
964130 2024-04-16T10:51:00 Z dubabuba Mobile (BOI12_mobile) C++14
100 / 100
779 ms 27464 KB
#include <bits/stdc++.h>
using namespace std;
 
typedef pair<int, int> pii;
#define x first
#define y second
#define MP make_pair
 
const int mxn = 1e6 + 10;
pii P[mxn];
int n, m;
 
bool can(double r) {
	double sus = 0;
	for(int i = 1; i <= n; i++) {
		double x = P[i].x;
		double y = abs(P[i].y);
		if(y > r) continue;
		double d = sqrt(r * r - y * y);
		double L = x - d, R = x + d;
		if(sus >= L) sus = max(sus, R);
	}
	return sus >= 1.0 * m;
}
 
int main() {
	cin >> n >> m;
	for(int i = 1; i <= n; i++)
		cin >> P[i].x >> P[i].y;
 
	double L = 0, R = 1e18;
	while(R - L > 0.0000001) {
		double M = (L + R) / 2;
		if(can(M)) R = M;
		else L = M;
	}
	printf("%.6lf\n", L);
	return 0;
}
# 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 0 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 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 512 KB Output is correct
2 Correct 5 ms 348 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 5 ms 496 KB Output is correct
3 Correct 3 ms 344 KB Output is correct
4 Correct 4 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 348 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 3 ms 348 KB Output is correct
4 Correct 4 ms 344 KB Output is correct
5 Correct 3 ms 520 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 58 ms 3412 KB Output is correct
2 Correct 53 ms 3728 KB Output is correct
3 Correct 34 ms 3124 KB Output is correct
4 Correct 54 ms 3664 KB Output is correct
5 Correct 25 ms 3060 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 44 ms 3264 KB Output is correct
2 Correct 43 ms 3420 KB Output is correct
3 Correct 49 ms 3536 KB Output is correct
4 Correct 53 ms 3672 KB Output is correct
5 Correct 67 ms 4104 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 50 ms 3164 KB Output is correct
2 Correct 63 ms 3424 KB Output is correct
3 Correct 53 ms 3356 KB Output is correct
4 Correct 79 ms 3924 KB Output is correct
5 Correct 52 ms 3576 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 3448 KB Output is correct
2 Correct 69 ms 3664 KB Output is correct
3 Correct 59 ms 3416 KB Output is correct
4 Correct 91 ms 3924 KB Output is correct
5 Correct 62 ms 3676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 73 ms 3668 KB Output is correct
2 Correct 70 ms 3732 KB Output is correct
3 Correct 59 ms 3416 KB Output is correct
4 Correct 76 ms 3828 KB Output is correct
5 Correct 61 ms 3928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 301 ms 7364 KB Output is correct
2 Correct 367 ms 12404 KB Output is correct
3 Correct 416 ms 11852 KB Output is correct
4 Correct 361 ms 14020 KB Output is correct
5 Correct 332 ms 11516 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 381 ms 9304 KB Output is correct
2 Correct 460 ms 11208 KB Output is correct
3 Correct 305 ms 10320 KB Output is correct
4 Correct 374 ms 14012 KB Output is correct
5 Correct 340 ms 11856 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 383 ms 9828 KB Output is correct
2 Correct 464 ms 16076 KB Output is correct
3 Correct 464 ms 15432 KB Output is correct
4 Correct 464 ms 18500 KB Output is correct
5 Correct 373 ms 14676 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 452 ms 12272 KB Output is correct
2 Correct 520 ms 14672 KB Output is correct
3 Correct 407 ms 13580 KB Output is correct
4 Correct 484 ms 18380 KB Output is correct
5 Correct 406 ms 15316 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 431 ms 10268 KB Output is correct
2 Correct 571 ms 17488 KB Output is correct
3 Correct 522 ms 16896 KB Output is correct
4 Correct 527 ms 20052 KB Output is correct
5 Correct 462 ms 15568 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 551 ms 13148 KB Output is correct
2 Correct 586 ms 15952 KB Output is correct
3 Correct 485 ms 15124 KB Output is correct
4 Correct 541 ms 19916 KB Output is correct
5 Correct 471 ms 16720 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 508 ms 10848 KB Output is correct
2 Correct 603 ms 19020 KB Output is correct
3 Correct 598 ms 18520 KB Output is correct
4 Correct 645 ms 22356 KB Output is correct
5 Correct 514 ms 17760 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 685 ms 13708 KB Output is correct
2 Correct 624 ms 17100 KB Output is correct
3 Correct 511 ms 16464 KB Output is correct
4 Correct 580 ms 22084 KB Output is correct
5 Correct 534 ms 18248 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 609 ms 13064 KB Output is correct
2 Correct 779 ms 23872 KB Output is correct
3 Correct 744 ms 22780 KB Output is correct
4 Correct 753 ms 27416 KB Output is correct
5 Correct 622 ms 21588 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 756 ms 21232 KB Output is correct
2 Correct 767 ms 21196 KB Output is correct
3 Correct 663 ms 20508 KB Output is correct
4 Correct 773 ms 27464 KB Output is correct
5 Correct 686 ms 22980 KB Output is correct