# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
841614 | a5a7 | Mobile (BOI12_mobile) | C++14 | 1088 ms | 90980 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>
#define ALL(x) (x).begin(), (x).end()
#define REP(i, a, b) for (int i = (a); i < (b); i++)
#define READ(arr, n) for (int i = 0; i < (n); i++) cin >> arr[i];
#define ABS(a) (max((a), -(a)))
using namespace std;
typedef long long ll;
typedef long double ld;
int main(){
ios::sync_with_stdio(false);
cin.tie(0);
int n; ld l;
cin >> n >> l;
pair<ld, ld> stations[n];
ld r = 0;
for (int i = 0; i < n; i++) {
cin >> stations[i].first >> stations[i].second;
r = max(r, sqrtl(max((ld) 0, (l-stations[i].first)*(l-stations[i].first)-stations[i].second*stations[i].second)));
}
ld le = 0;
while ((r-le)>0.0001){
ld m = (le+r)/2;
vector<pair<ld, ld>> ranges;
for (int i = 0; i < n; i++){
if (ABS(stations[i].second) >= m) continue;
ld sq = sqrtl(m * m - stations[i].second * stations[i].second);
ranges.push_back({stations[i].first-sq, stations[i].first+sq});
}
sort(ALL(ranges));
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... |