답안 #941333

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
941333 2024-03-08T14:41:56 Z Kavelmydex Mobile (BOI12_mobile) C++17
36 / 100
451 ms 27348 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);}

double eps = 1e-9;
vector <pi> v;
int n,L;
bool ok(double m){
    double mn = 2e9, mx = -2e9, z = 0;
    For(i,n){
        auto [x,y] = v[i];
        if(y*y > m*m) continue;
        double d = sqrt(m * m - y * y);
        if(x-d <= z && z <= x+d){
            z = x+d;
        }   
        if(x-d < mn) mn = x-d;
        if(mx < x+d) mx = x+d;    
    }
    if(z >= L){
        assert(z >= mx);    
    }
    return (mn <= 0 && L <= mx && z >= 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,60){
        double m = (l+r)/2;
        if(ok(m)) r = m;
        else l = m;
    }
    cout << setprecision(10) << r << endl;
    return 0;
}
# 결과 실행 시간 메모리 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 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 344 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Runtime error 1 ms 604 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 3 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 572 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 604 KB Output is correct
2 Correct 2 ms 604 KB Output is correct
3 Correct 2 ms 604 KB Output is correct
4 Correct 2 ms 604 KB Output is correct
5 Correct 2 ms 600 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 34 ms 2516 KB Output is correct
2 Correct 30 ms 2520 KB Output is correct
3 Correct 21 ms 1496 KB Output is correct
4 Correct 22 ms 2520 KB Output is correct
5 Correct 13 ms 1500 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 21 ms 2516 KB Output is correct
2 Correct 20 ms 2520 KB Output is correct
3 Correct 26 ms 2776 KB Output is correct
4 Correct 22 ms 2516 KB Output is correct
5 Correct 24 ms 2520 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 31 ms 2772 KB Output is correct
2 Correct 37 ms 2520 KB Output is correct
3 Correct 27 ms 2520 KB Output is correct
4 Runtime error 26 ms 4052 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 36 ms 2520 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 45 ms 2520 KB Output is correct
2 Correct 38 ms 2520 KB Output is correct
3 Correct 32 ms 2520 KB Output is correct
4 Runtime error 28 ms 4052 KB Execution killed with signal 6
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 175 ms 8768 KB Output is correct
2 Incorrect 210 ms 9104 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 179 ms 9672 KB Output is correct
2 Correct 268 ms 9924 KB Output is correct
3 Correct 148 ms 10188 KB Output is correct
4 Correct 126 ms 9408 KB Output is correct
5 Runtime error 112 ms 16568 KB Execution killed with signal 6
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 209 ms 17780 KB Output is correct
2 Incorrect 208 ms 18172 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 213 ms 18104 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 260 ms 17236 KB Output is correct
2 Incorrect 243 ms 17064 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 254 ms 18800 KB Output is correct
2 Correct 326 ms 19020 KB Output is correct
3 Correct 213 ms 18876 KB Output is correct
4 Correct 196 ms 17080 KB Output is correct
5 Runtime error 168 ms 23216 KB Execution killed with signal 6
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 268 ms 18184 KB Output is correct
2 Incorrect 281 ms 17844 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 283 ms 17676 KB Output is correct
2 Runtime error 257 ms 27348 KB Execution killed with signal 6
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 388 ms 17816 KB Output is correct
2 Incorrect 374 ms 18360 KB Output isn't correct
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 353 ms 18440 KB Output is correct
2 Correct 451 ms 17756 KB Output is correct
3 Correct 307 ms 18872 KB Output is correct
4 Correct 289 ms 18588 KB Output is correct
5 Correct 258 ms 17428 KB Output is correct