Submission #1035045

# Submission time Handle Problem Language Result Execution time Memory
1035045 2024-07-26T03:28:51 Z Uniq0rn Mobile (BOI12_mobile) C++17
0 / 100
414 ms 29084 KB
#include <bits/stdc++.h>
using namespace std;
 
#define ld long double 
#define ll long long int
#define pi pair<int,int>
#define sz(x) (int)x.size()
#define all(x) begin(x),end(x)

int main()
{
    cin.tie(0)->sync_with_stdio(0);
    int n;
    double L;
    cin >> n >> L;
    vector<pair<double,double>> a(n);
    for(int i=0;i<n;i++){
        cin >> a[i].first >> a[i].second;
    }
    sort(all(a));
    auto len = [&](double a,double b){
        return sqrt(a*a - b*b);
    };
    double l = 0,r = 1e9;
    while(r - l > 0.000001){
        double mid = (l + r) / 2.0;
        double mn = a[0].first - len(mid,a[0].second),mx = a[0].first + len(mid,a[0].second);
        bool ch = (mid >= a[0].second);
        for(int i=1;i<n && ch;i++){
            if(mid < a[0].second){
                ch = false;
                break;
            }
            double le = a[i].first - len(mid,a[i].second),ri = a[i].first + len(mid,a[i].second);
            if(le <= mx){
                mx = ri;
            }
            else{
                ch = false;
                break;
            }
        }
        if(ch && mn <= 0 && mx >= L){
            r = mid;
        }
        else{
            l = mid;
        }
    }
    cout << setprecision(6) << fixed << r;
    return 0;
}
# 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 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 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 2 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 2 ms 588 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 2396 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 28 ms 2392 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 33 ms 2396 KB Output is correct
2 Incorrect 34 ms 2776 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 43 ms 3552 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 41 ms 3420 KB Output is correct
2 Incorrect 43 ms 3408 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 181 ms 11860 KB Output is correct
2 Correct 200 ms 14416 KB Output is correct
3 Correct 212 ms 14160 KB Output is correct
4 Incorrect 197 ms 16208 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 215 ms 15160 KB Output is correct
2 Incorrect 177 ms 13856 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 202 ms 14412 KB Output is correct
2 Incorrect 215 ms 17488 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 232 ms 17640 KB Output is correct
2 Incorrect 204 ms 16208 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 237 ms 16468 KB Output is correct
2 Incorrect 279 ms 20416 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 268 ms 20624 KB Output is correct
2 Incorrect 219 ms 19028 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 272 ms 18772 KB Output is correct
2 Incorrect 300 ms 22932 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 310 ms 23632 KB Output is correct
2 Incorrect 268 ms 21588 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 355 ms 23240 KB Output is correct
2 Incorrect 388 ms 28240 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 414 ms 29084 KB Output is correct
2 Incorrect 327 ms 26428 KB Output isn't correct
3 Halted 0 ms 0 KB -