Submission #973123

# Submission time Handle Problem Language Result Execution time Memory
973123 2024-05-01T13:58:29 Z njoop Mobile (BOI12_mobile) C++17
0 / 100
603 ms 49240 KB
#include <bits/stdc++.h>
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx2,bmi,bmi2,lzcnt,popcnt")
#define pi pair<double, double>
using namespace std;

double x, y, L, l=0, r=1e9, mid, de, cov;
pi arr[1000010];
vector<pi> in;
int n;

bool solve(double rad) {
    in.clear();
    cov = 0;
    for(int i=1; i<=n; i++) {
        de = pow(rad, 2) - pow(abs(arr[i].second), 2);
        de = sqrt(de);
        if(de < 0) continue;
        in.push_back({arr[i].first-de, arr[i].first+de});
    }
    for(auto i: in) {
        if(i.first > cov) return 0;
        cov = max(cov, i.second);
        if(cov >= L) return 1;
    }
    return 0;
}

int main() {
    cin.tie(0)->sync_with_stdio(0);
    cin >> n >> L;
    for(int i=1; i<=n; i++) {
        cin >> arr[i].first >> arr[i].second;
    }
    while(l+0.0001 < r) {
        mid = (l+r)/2;
        if(solve(mid)) {
            r = mid;
        } else {
            l = mid + 0.0001;
        }
    }
    cout << fixed << setprecision(6) << l;
    return 0;
}
# 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 Incorrect 1 ms 348 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 600 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Incorrect 1 ms 348 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 600 KB Output is correct
2 Correct 3 ms 732 KB Output is correct
3 Incorrect 3 ms 604 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 604 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 4860 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 38 ms 4812 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 40 ms 4860 KB Output is correct
2 Incorrect 39 ms 4872 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 49 ms 4816 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 59 ms 4812 KB Output is correct
2 Incorrect 51 ms 4812 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 232 ms 18920 KB Output is correct
2 Correct 236 ms 18156 KB Output is correct
3 Correct 233 ms 25288 KB Output is correct
4 Incorrect 289 ms 27880 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 242 ms 17640 KB Output is correct
2 Incorrect 358 ms 23992 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 277 ms 27584 KB Output is correct
2 Incorrect 285 ms 27368 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 298 ms 28664 KB Output is correct
2 Incorrect 394 ms 36544 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 337 ms 30196 KB Output is correct
2 Incorrect 328 ms 30660 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 367 ms 30180 KB Output is correct
2 Incorrect 436 ms 40676 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 382 ms 33532 KB Output is correct
2 Incorrect 385 ms 33268 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 393 ms 32492 KB Output is correct
2 Incorrect 488 ms 42212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 479 ms 33220 KB Output is correct
2 Incorrect 479 ms 49240 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 520 ms 34040 KB Output is correct
2 Incorrect 603 ms 47704 KB Output isn't correct
3 Halted 0 ms 0 KB -