Submission #1093728

# Submission time Handle Problem Language Result Execution time Memory
1093728 2024-09-27T10:40:14 Z michified Mobile (BOI12_mobile) C++17
8 / 100
881 ms 48212 KB
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define lid id * 2 + 1
#define rid id * 2 + 2
using namespace std;

const ll mod = 1e9 + 7;

struct coord_t {
    ld x, y;
};

bool all(ld rad, ld l, vector<coord_t>& towers) {
    ld cur = 0, radsq = rad * rad;
    for (auto& t : towers) {
        if (t.y > rad) continue;
        ld horiz = sqrt(radsq - (t.y * t.y));
        if (t.x - horiz > cur) continue;
        cur = max(cur, t.x + horiz);
    }
    return cur >= l;
}

int main() {
    // ifstream cin("valleys.in");
    // ofstream cout("valleys.out");
    
    ld n, L, i, tx, ty;
    cin >> n >> L;
    vector<coord_t> towers(n);
    for (i = 0; i < n; i++) {
        cin >> tx >> ty;
        towers[i] = {tx, ty};
    }
    ld l = 0, r = 2e9, tol = 0.000001;
    while (l < r - tol) {
        ld mid = (l + r) / 2;
        if (not all(mid, L, towers)) l = mid;
        else r = mid - tol;
    }
    cout << l;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 0 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 4 ms 348 KB Output is correct
3 Correct 2 ms 520 KB Output is correct
4 Incorrect 2 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 604 KB Output is correct
2 Incorrect 7 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 604 KB Output is correct
2 Incorrect 4 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 6 ms 604 KB Output is correct
2 Incorrect 4 ms 604 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 89 ms 3396 KB Output is correct
2 Incorrect 62 ms 3672 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 79 ms 3420 KB Output is correct
2 Correct 84 ms 3420 KB Output is correct
3 Incorrect 145 ms 3920 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 69 ms 3772 KB Output is correct
2 Incorrect 69 ms 4160 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 83 ms 5096 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 93 ms 4952 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 384 ms 20304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 467 ms 24268 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 444 ms 24208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 583 ms 29008 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 540 ms 28220 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 626 ms 33616 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 601 ms 32336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 691 ms 38484 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 792 ms 40276 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 881 ms 48212 KB Output isn't correct
2 Halted 0 ms 0 KB -