Submission #941213

# Submission time Handle Problem Language Result Execution time Memory
941213 2024-03-08T09:40:43 Z Kavelmydex Mobile (BOI12_mobile) C++17
4 / 100
888 ms 35308 KB
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define pi pair<int,int>
#define vi vector<int>
#define rep(i,x,n) for(int i=x; i<n; ++i)
#define For(i,n) rep(i,0,n)
#define pb push_back
#define endl "\n"
#define sp ' '
#define f first
#define s second
#define sz size()
#define all(x) (x).begin(),(x).end()

const int N = 3e5+10, OO = 1e18, mod = 1e9+7;
void tr(int a, int b){cout << a << sp << b << endl;}
void cmx(int &a, int b){a = max(a,b);}
void cmn(int &a, int b){a = min(a,b);}

vector <pi> v;
double n,L;
bool ok(double m){
    double mn = OO, mx = -OO;
    For(i,n){
        auto [x,y] = v[i];
        if(y*y > m*m) continue;
        double d = sqrt(m * m - y * y);
        if(x - d > mx && mx != -OO) return 0; 
        if(x-d < mn) mn = x-d;
        if(mx < x+d) mx = x+d;   
    }
    return (mn <= 0 && L <= mx);
}
int32_t main() {
    ios::sync_with_stdio(0); cin.tie(0);
    cin >> n >> L;
    For(i,n){
        int x,y; cin >> x >> y;
        v.pb({x,y});
    }
    double l = 0, r = 1e10;
    For(i,100){
        double m = (l+r)/2;
        bool b = ok(m);
        if(b) r = m;
        else l = m;
    }
    cout << setprecision(20) << r << endl;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 348 KB Output isn't correct
2 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 3 ms 600 KB Output isn't correct
2 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 88 ms 2516 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 32 ms 2520 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 45 ms 2520 KB Output is correct
2 Correct 50 ms 3544 KB Output is correct
3 Correct 40 ms 3544 KB Output is correct
4 Incorrect 33 ms 4056 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 58 ms 2520 KB Output is correct
2 Correct 62 ms 3544 KB Output is correct
3 Correct 65 ms 3544 KB Output is correct
4 Incorrect 56 ms 4056 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 57 ms 2516 KB Output is correct
2 Correct 55 ms 3796 KB Output is correct
3 Correct 53 ms 3288 KB Output is correct
4 Incorrect 40 ms 4056 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 322 ms 10688 KB Output is correct
2 Correct 294 ms 16024 KB Output is correct
3 Correct 278 ms 15580 KB Output is correct
4 Incorrect 187 ms 17848 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 296 ms 10772 KB Output is correct
2 Incorrect 519 ms 14836 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 331 ms 17080 KB Output is correct
2 Correct 369 ms 27088 KB Output is correct
3 Correct 332 ms 25408 KB Output is correct
4 Incorrect 223 ms 29228 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 364 ms 17276 KB Output is correct
2 Incorrect 724 ms 24852 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 361 ms 17796 KB Output is correct
2 Correct 377 ms 25296 KB Output is correct
3 Correct 367 ms 26036 KB Output is correct
4 Incorrect 245 ms 27512 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 404 ms 17752 KB Output is correct
2 Incorrect 793 ms 24116 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 432 ms 18620 KB Output is correct
2 Correct 421 ms 25528 KB Output is correct
3 Correct 431 ms 26552 KB Output is correct
4 Incorrect 262 ms 28592 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 432 ms 17908 KB Output is correct
2 Incorrect 880 ms 25588 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 508 ms 16824 KB Output is correct
2 Correct 532 ms 31664 KB Output is correct
3 Correct 542 ms 30636 KB Output is correct
4 Correct 351 ms 35308 KB Output is correct
5 Incorrect 404 ms 30380 KB Output isn't correct
6 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 539 ms 24620 KB Output is correct
2 Incorrect 888 ms 29616 KB Output isn't correct
3 Halted 0 ms 0 KB -