Submission #906201

# Submission time Handle Problem Language Result Execution time Memory
906201 2024-01-13T15:24:50 Z Mikhail Mobile (BOI12_mobile) C++14
8 / 100
924 ms 16312 KB
#include <iostream>
#include <math.h>
#define MAX_N 1000000
double x[MAX_N], y[MAX_N];
#define MAX(a,b)  ((a > b) ? a : b)

using namespace std;

int main() {
	int N;
	cin >> N;
	double L;
	cin >> L;

	for (int i = 0; i < N; i++) {
		cin >> x[i] >> y[i];
		y[i] = y[i] * y[i];
	}


	double l = 0., m, r = 2e9, m_sqr, c, t0, tn;
	while(r - l > 0.00001) {
		m = l / 2 + r / 2;
		m_sqr = m * m;
		c = 0.;
		for (int j = 0; j < N; j++) {
			if (m_sqr < y[j]) continue;
			t0 = sqrt(m_sqr - y[j]);
			tn = x[j] - t0;
			if (tn > c) continue;
			t0 += x[j];
			c = MAX(t0, c);
		}
		//cout << c << ' ' << l << ' ' << r << ' ' << min_t <<  '\n';
		if (c > L) r = m;
		else l = m;
	}
	cout << l / 2 + r / 2 << '\n';
	return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2392 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2392 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2396 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 1 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 2392 KB Output is correct
2 Correct 3 ms 2392 KB Output is correct
3 Correct 3 ms 2480 KB Output is correct
4 Incorrect 3 ms 2396 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 2396 KB Output is correct
2 Incorrect 5 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2392 KB Output is correct
2 Incorrect 6 ms 2392 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 2396 KB Output is correct
2 Incorrect 5 ms 2396 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 60 ms 6736 KB Output is correct
2 Incorrect 64 ms 6736 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 55 ms 6748 KB Output is correct
2 Correct 52 ms 4696 KB Output is correct
3 Incorrect 61 ms 6744 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 60 ms 6752 KB Output is correct
2 Incorrect 71 ms 6996 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 86 ms 6748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 85 ms 6736 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 375 ms 11108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 468 ms 10856 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 444 ms 14940 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 533 ms 15192 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 491 ms 14960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 633 ms 15188 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 552 ms 14956 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 712 ms 15452 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 698 ms 16068 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 924 ms 16312 KB Output isn't correct
2 Halted 0 ms 0 KB -