# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
964111 | dubabuba | Mobile (BOI12_mobile) | C++14 | 1082 ms | 55432 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#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, l;
bool can(double r) {
vector<pair<double, double>> v;
for(int i = 1; i <= n; i++) {
pii &p = P[i];
double X = p.x;
double Y = p.y;
double sq = r * r - Y * Y;
if(sq < 0) continue;
sq = sqrt(sq);
double f = X - sq, s = X + sq;
if(f < 0) f = 0;
if(s < 0) s = 0;
if(f != s) v.push_back(MP(f, s));
}
sort(v.begin(), v.end());
for(int i = 1; i < v.size(); i++) {
if(v[i - 1].second < v[i].first) {
if(v[i].first > 0.0) return 1;
if(v[i - 1].second < (double) l) return 1;
}
}
return 0;
}
int main() {
cin >> n >> l;
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)) L = M;
else R = M;
}
printf("%.6lf\n", L);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |