Submission #829479

# Submission time Handle Problem Language Result Execution time Memory
829479 2023-08-18T11:12:51 Z soumyojit_sen Mobile (BOI12_mobile) C++14
0 / 100
663 ms 24616 KB
#include <bits/stdc++.h>
using namespace std;
vector<pair<int,int>> pts;
int n,L;

bool works(double d){
	double left = DBL_MIN, right = DBL_MAX;

	for(int i = 0; i < n; i++){
		left = max(left, pts[i].first - sqrt(d*d - pts[i].second*pts[i].second));
		right = min(right, pts[i].first + sqrt(d*d - pts[i].second*pts[i].second));
	}
	return left <= right;
}

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

	double bad = -1.0;
	double good = 2e9;
	for(int i = 0; i < 60; i++){
		double mid = bad + (good - bad)/2.0;
		if(works(mid)){
			good = mid;
		} else {
			bad = mid;
		}
	}
	cout << fixed << setprecision(6) << good;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 296 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 312 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 312 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 4 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 340 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1668 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 45 ms 1544 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 1620 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 65 ms 2604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 64 ms 2472 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 260 ms 8420 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 352 ms 12388 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 306 ms 10164 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 402 ms 14836 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 366 ms 11896 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 470 ms 17284 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 412 ms 13452 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 538 ms 19732 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 506 ms 16684 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 663 ms 24616 KB Output isn't correct
2 Halted 0 ms 0 KB -