Submission #678864

# Submission time Handle Problem Language Result Execution time Memory
678864 2023-01-06T18:55:42 Z scrge Mobile (BOI12_mobile) C++17
0 / 100
257 ms 5492 KB
#include <bits/stdc++.h>
using namespace std;

int n, l;
pair<double, double> base[100000];

bool check(double r){
	pair<double, double> seg[100000];
	for(int i = 0; i < n; i++){
		double x = base[i].first, y = base[i].second;
		if(r*r < y*y) continue;
		double d = sqrt(r*r-y*y);
		seg[i] = {max((double)0, x-d), min(x+d, (double)l)};
	}

	sort(seg, seg+n);
	
	double right = 0;	
	for(int i = 0; i < n; i++){
		if(seg[i].first > right) return true;
		right = max(right, seg[i].second);
	}
	return false;
}

int main(){
	cin >> n >> l;
	for(int i = 0; i < n; i++)
		cin >> base[i].first >> base[i].second;

	double l = 0, r = INT_MAX;
	while(l+1e-4 < r){
		double mid = (l+r)/2;
		if(check(mid)) l = mid;
		else r = mid;
	}

	cout << l << endl;
}
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 1872 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 15 ms 1876 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 13 ms 2004 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 163 ms 3964 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 257 ms 3816 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 166 ms 3796 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 257 ms 4960 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 235 ms 4920 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 68 ms 4496 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 102 ms 5324 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 69 ms 4532 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 105 ms 5452 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 67 ms 4508 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 105 ms 5420 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 76 ms 4556 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 103 ms 5492 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 72 ms 4560 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 104 ms 5448 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -