Submission #470618

# Submission time Handle Problem Language Result Execution time Memory
470618 2021-09-04T15:45:56 Z zxcvbnm Mobile (BOI12_mobile) C++14
0 / 100
1000 ms 47996 KB
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ld = long double;
struct P {
    ld x, y;
};
vector<P> a;
int n, L;
bool ok(ld r) {
    ld curr = 0;
    for(int i = 0; i < n; i++) {
        if (r * r < a[i].y * a[i].y) continue;
        ld sol = sqrt(r * r - a[i].y * a[i].y);
        ld left = max((ld) 0, a[i].x - sol);
        ld right = min((ld) L, a[i].x + sol);
        if (left <= curr) {
            curr = right;
        }
    }

//    cout << curr << "\n";
    return curr >= L;
}
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cin >> n >> L;
    a.resize(n);
    for(auto& i : a) {
        cin >> i.x >> i.y;
    }

    ld l = 0, r = 1e10;
    ld ans = r;
    for(int rep = 0; rep < 60; rep++) {
        ld mid = (l + r) / 2;
        if (ok(mid)) {
            r = mid;
            ans = mid;
        }
        else {
            l = mid;
        }
    }

    cout << fixed << setprecision(7) << ans << "\n";
}
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 5 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 8 ms 460 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 117 ms 3436 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 117 ms 3396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 130 ms 3696 KB Output is correct
2 Correct 139 ms 4036 KB Output is correct
3 Correct 113 ms 3856 KB Output is correct
4 Incorrect 168 ms 5348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 163 ms 4964 KB Output is correct
2 Correct 156 ms 4856 KB Output is correct
3 Correct 135 ms 4468 KB Output is correct
4 Incorrect 168 ms 5364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 163 ms 4932 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 733 ms 20180 KB Output is correct
2 Correct 786 ms 23636 KB Output is correct
3 Correct 791 ms 23108 KB Output is correct
4 Incorrect 828 ms 25540 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 805 ms 24260 KB Output is correct
2 Incorrect 766 ms 22476 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 871 ms 24208 KB Output is correct
2 Correct 956 ms 28356 KB Output is correct
3 Correct 925 ms 27692 KB Output is correct
4 Incorrect 986 ms 30964 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 963 ms 28940 KB Output is correct
2 Incorrect 915 ms 26948 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1008 ms 28220 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1095 ms 33740 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1088 ms 32264 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1098 ms 38532 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1091 ms 40252 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1091 ms 47996 KB Time limit exceeded
2 Halted 0 ms 0 KB -