Submission #493532

# Submission time Handle Problem Language Result Execution time Memory
493532 2021-12-11T21:56:31 Z imaginary_unit Mobile (BOI12_mobile) C++17
12 / 100
464 ms 8176 KB
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

int n, l, x[1'000'000], y[1'000'000];

bool ok(double r)
{
    double cur=0;
    for(int i=0; i<n; i++){
        double delta=sqrt(r*r-y[i]*y[i]), a=x[i]-delta, b=x[i]+delta;
        if(a<=cur){
            cur=max(cur, b);
        }
    }
    return cur >= l;
}

double MinRadius(double l, double r)
{
    for(int i=0; i<100; i++){
        double m=(l+r)/2;
        if(ok(m)){
            r=m;
        }
        else{
            l=m;
        }
    }
    return r;
}

int main()
{
    scanf("%d %d", &n, &l);
    for(int i=0; i<n; i++){
        scanf("%d %d", &x[i], &y[i]);
    }
    cout << fixed << setprecision(4) << MinRadius(0, 1e9+1);
    return 0;
}

Compilation message

mobile.cpp: In function 'int main()':
mobile.cpp:37:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |     scanf("%d %d", &n, &l);
      |     ~~~~~^~~~~~~~~~~~~~~~~
mobile.cpp:39:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   39 |         scanf("%d %d", &x[i], &y[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 0 ms 252 KB Output is correct
4 Correct 0 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 204 KB Output is correct
2 Correct 2 ms 304 KB Output is correct
3 Correct 3 ms 204 KB Output is correct
4 Correct 2 ms 204 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 4 ms 348 KB Output is correct
2 Correct 2 ms 332 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Incorrect 6 ms 332 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB Output is correct
2 Correct 2 ms 332 KB Output is correct
3 Correct 3 ms 332 KB Output is correct
4 Incorrect 6 ms 332 KB Output isn't correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 332 KB Output is correct
2 Correct 2 ms 332 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Incorrect 7 ms 340 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 72 ms 868 KB Output is correct
2 Incorrect 36 ms 844 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 42 ms 900 KB Output is correct
2 Correct 40 ms 844 KB Output is correct
3 Incorrect 92 ms 924 KB Output isn't correct
4 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 36 ms 972 KB Output is correct
2 Incorrect 44 ms 928 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 48 ms 1080 KB Output is correct
2 Incorrect 55 ms 1076 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 1096 KB Output is correct
2 Incorrect 46 ms 1056 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 225 ms 4200 KB Output is correct
2 Incorrect 249 ms 4200 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 231 ms 4168 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 257 ms 4980 KB Output is correct
2 Incorrect 274 ms 4976 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 285 ms 4976 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 297 ms 5692 KB Output is correct
2 Incorrect 329 ms 5736 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 332 ms 5756 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 336 ms 6512 KB Output is correct
2 Incorrect 373 ms 6548 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 374 ms 6652 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 420 ms 8004 KB Output is correct
2 Incorrect 454 ms 8176 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 464 ms 8092 KB Output isn't correct
2 Halted 0 ms 0 KB -