Submission #1035042

# Submission time Handle Problem Language Result Execution time Memory
1035042 2024-07-26T03:27:00 Z Uniq0rn Mobile (BOI12_mobile) C++17
0 / 100
409 ms 24400 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(auto &[x,y]:a) cin >> x >> y;
    sort(all(a));
    auto len = [&](double a,double b){
        return sqrt(a*a - b*b);
    };
    double l = 0,r = 1e9;
    while(r - l > 0.0001){
        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 0 ms 604 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 1 ms 348 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 2 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 27 ms 2396 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 Correct 32 ms 2392 KB Output is correct
2 Incorrect 33 ms 2908 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 41 ms 3416 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 39 ms 3420 KB Output is correct
2 Incorrect 39 ms 3412 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 178 ms 11608 KB Output is correct
2 Correct 205 ms 14412 KB Output is correct
3 Correct 197 ms 14160 KB Output is correct
4 Incorrect 193 ms 13140 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 199 ms 12484 KB Output is correct
2 Incorrect 185 ms 11860 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 215 ms 12640 KB Output is correct
2 Incorrect 242 ms 14672 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 242 ms 14928 KB Output is correct
2 Incorrect 214 ms 13904 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 257 ms 14720 KB Output is correct
2 Incorrect 281 ms 16980 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 292 ms 17272 KB Output is correct
2 Incorrect 243 ms 16208 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 285 ms 16796 KB Output is correct
2 Incorrect 326 ms 19244 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 326 ms 19624 KB Output is correct
2 Incorrect 291 ms 18452 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 353 ms 20456 KB Output is correct
2 Incorrect 403 ms 23892 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 409 ms 24400 KB Output is correct
2 Incorrect 337 ms 22864 KB Output isn't correct
3 Halted 0 ms 0 KB -