Submission #713014

# Submission time Handle Problem Language Result Execution time Memory
713014 2023-03-20T21:51:30 Z Ahmed57 Mobile (BOI12_mobile) C++14
80 / 100
1000 ms 35276 KB
#include <bits/stdc++.h>

using namespace std;
pair<double,double> cordinates[1000001];
int n;double l;
bool ch(double mid){
    double cur = 0;
    for(int i =0;i<n;i++){
        if(cordinates[i].second>mid)continue;
        double x = sqrt((mid*mid)-(cordinates[i].second*cordinates[i].second));
        double begi = cordinates[i].first-x;
        double en = cordinates[i].first+x;
        if(begi<=cur)cur = max(cur,en);
    }
    return (cur>=l);
}
int main(){
    ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
    cin>>n>>l;
    for(int i = 0;i<n;i++){
        cin>>cordinates[i].first>>cordinates[i].second;
    }
    double l = 0.0 ,r = 1000000000.0;
    for(int i = 0;i<100;i++){
        double mid=(l+r)/2.0;
        if(ch(mid))r = mid;
        else l = mid;
    }
    cout<<setprecision(9)<<fixed<<r<<endl;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 336 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 328 KB Output is correct
3 Correct 1 ms 212 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
3 Correct 3 ms 340 KB Output is correct
4 Correct 3 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 340 KB Output is correct
2 Correct 4 ms 468 KB Output is correct
3 Correct 4 ms 416 KB Output is correct
4 Correct 6 ms 412 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 7 ms 340 KB Output is correct
2 Correct 4 ms 340 KB Output is correct
3 Correct 4 ms 340 KB Output is correct
4 Correct 7 ms 468 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 10 ms 336 KB Output is correct
2 Correct 4 ms 468 KB Output is correct
3 Correct 5 ms 384 KB Output is correct
4 Correct 7 ms 472 KB Output is correct
5 Correct 4 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 67 ms 2160 KB Output is correct
2 Correct 57 ms 2472 KB Output is correct
3 Correct 34 ms 1772 KB Output is correct
4 Correct 98 ms 2656 KB Output is correct
5 Correct 32 ms 1492 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 56 ms 2280 KB Output is correct
2 Correct 85 ms 2252 KB Output is correct
3 Correct 92 ms 2608 KB Output is correct
4 Correct 100 ms 2756 KB Output is correct
5 Correct 107 ms 3148 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 57 ms 2356 KB Output is correct
2 Correct 66 ms 2920 KB Output is correct
3 Correct 68 ms 2520 KB Output is correct
4 Correct 139 ms 3808 KB Output is correct
5 Correct 84 ms 2628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 77 ms 3440 KB Output is correct
2 Correct 77 ms 3228 KB Output is correct
3 Correct 64 ms 2792 KB Output is correct
4 Correct 129 ms 3824 KB Output is correct
5 Correct 131 ms 3128 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 81 ms 3376 KB Output is correct
2 Correct 74 ms 3160 KB Output is correct
3 Correct 65 ms 2828 KB Output is correct
4 Correct 146 ms 3820 KB Output is correct
5 Correct 125 ms 3244 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 353 ms 12428 KB Output is correct
2 Correct 424 ms 15760 KB Output is correct
3 Correct 374 ms 15280 KB Output is correct
4 Correct 654 ms 17764 KB Output is correct
5 Correct 652 ms 14888 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 428 ms 16460 KB Output is correct
2 Correct 499 ms 14752 KB Output is correct
3 Correct 340 ms 13896 KB Output is correct
4 Correct 670 ms 17540 KB Output is correct
5 Correct 605 ms 15456 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 400 ms 14796 KB Output is correct
2 Correct 483 ms 18996 KB Output is correct
3 Correct 453 ms 18352 KB Output is correct
4 Correct 781 ms 21604 KB Output is correct
5 Correct 729 ms 17696 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 481 ms 19588 KB Output is correct
2 Correct 575 ms 17632 KB Output is correct
3 Correct 397 ms 16536 KB Output is correct
4 Correct 850 ms 21464 KB Output is correct
5 Correct 712 ms 18440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 517 ms 17352 KB Output is correct
2 Correct 583 ms 22120 KB Output is correct
3 Correct 534 ms 21476 KB Output is correct
4 Correct 914 ms 24912 KB Output is correct
5 Correct 810 ms 20312 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 552 ms 22864 KB Output is correct
2 Correct 654 ms 20524 KB Output is correct
3 Correct 514 ms 19592 KB Output is correct
4 Correct 893 ms 24748 KB Output is correct
5 Correct 818 ms 21428 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 524 ms 19796 KB Output is correct
2 Correct 609 ms 25320 KB Output is correct
3 Correct 610 ms 24476 KB Output is correct
4 Execution timed out 1059 ms 28624 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 631 ms 25928 KB Output is correct
2 Correct 715 ms 23452 KB Output is correct
3 Correct 511 ms 22508 KB Output is correct
4 Execution timed out 1014 ms 28304 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 660 ms 24672 KB Output is correct
2 Correct 746 ms 31540 KB Output is correct
3 Correct 747 ms 30532 KB Output is correct
4 Execution timed out 1058 ms 35136 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 783 ms 32384 KB Output is correct
2 Correct 857 ms 29260 KB Output is correct
3 Correct 667 ms 28236 KB Output is correct
4 Execution timed out 1075 ms 35276 KB Time limit exceeded
5 Halted 0 ms 0 KB -