Submission #670284

# Submission time Handle Problem Language Result Execution time Memory
670284 2022-12-08T14:47:05 Z RadicaI Mobile (BOI12_mobile) C++17
8 / 100
768 ms 15948 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
	cout.precision(7);
	int n,siz; cin >> n>>siz;
	pair<ll, ll> stations[n];
	for(int i=0; i<n; i++) cin >> stations[i].first >> stations[i].second;
	double l = 1; double r = 1.5e9;
	while(r - l > 1e-3){
		double m = (l+r)/2.0;
		double store=0;
		for(int i=0; i<n; i++){
			if(abs(stations[i].second) <=m){
				double ph = stations[i].first + sqrt(m*m-stations[i].second*stations[i].second);
				double pl = stations[i].first - sqrt(m*m-stations[i].second*stations[i].second);
				if(pl<=store) store = max(store, ph);
			}
		}
		if(store>=siz) r=m;
		else l=m;
		
	}
	cout << l;
}
# 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 1 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 1 ms 256 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 0 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 1 ms 212 KB Output is correct
4 Incorrect 2 ms 212 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Incorrect 4 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 372 KB Output is correct
2 Incorrect 4 ms 340 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 4 ms 340 KB Output is correct
2 Incorrect 5 ms 380 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 51 ms 1364 KB Output is correct
2 Incorrect 58 ms 1472 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 49 ms 1492 KB Output is correct
2 Correct 42 ms 1376 KB Output is correct
3 Correct 51 ms 1544 KB Output is correct
4 Incorrect 54 ms 1512 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 44 ms 1648 KB Output is correct
2 Incorrect 56 ms 1552 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 75 ms 1840 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 74 ms 1748 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 273 ms 8100 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 382 ms 8108 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 335 ms 9664 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 581 ms 9664 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 383 ms 11340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 529 ms 11228 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 451 ms 12796 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 768 ms 12792 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 545 ms 15948 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 747 ms 15924 KB Output isn't correct
2 Halted 0 ms 0 KB -