Submission #920756

# Submission time Handle Problem Language Result Execution time Memory
920756 2024-02-03T02:35:40 Z ethanv13 Mobile (BOI12_mobile) C++17
100 / 100
410 ms 35408 KB
#include <bits/stdc++.h>
using namespace std;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    long long n,l;cin>>n>>l;
    vector<pair<long long,long long>>a(n);
    for(int i=0;i<n;++i){
        cin>>a[i].first>>a[i].second;
    }
    double lo=0;
    double hi=4e9;
    double delta=1e-5;
    while(hi-lo>delta){
        double mid=(lo+hi)/2;
        double curr=0;
        for(int i=0;i<n;++i){
            double dist=sqrt(mid*mid-a[i].second*a[i].second);
            if(a[i].first-dist<=curr){curr=max(a[i].first+dist,curr);}
        }
        if(curr>=l){hi=mid;}else{lo=mid;}
    }
    cout<<fixed<<setprecision(5);
    cout<<lo<<endl;
}
# Verdict Execution time Memory 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
# Verdict Execution time Memory 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 404 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 1 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 344 KB Output is correct
3 Correct 2 ms 344 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 348 KB Output is correct
2 Correct 2 ms 348 KB Output is correct
3 Correct 2 ms 348 KB Output is correct
4 Correct 2 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 30 ms 1628 KB Output is correct
2 Correct 20 ms 1668 KB Output is correct
3 Correct 14 ms 1116 KB Output is correct
4 Correct 27 ms 1628 KB Output is correct
5 Correct 14 ms 1116 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 23 ms 1628 KB Output is correct
2 Correct 22 ms 1368 KB Output is correct
3 Correct 26 ms 1628 KB Output is correct
4 Correct 27 ms 1624 KB Output is correct
5 Correct 31 ms 1628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 1624 KB Output is correct
2 Correct 22 ms 1624 KB Output is correct
3 Correct 22 ms 1796 KB Output is correct
4 Correct 45 ms 2016 KB Output is correct
5 Correct 27 ms 1868 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 1884 KB Output is correct
2 Correct 27 ms 1880 KB Output is correct
3 Correct 26 ms 1884 KB Output is correct
4 Correct 48 ms 2012 KB Output is correct
5 Correct 32 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 27 ms 2016 KB Output is correct
2 Correct 27 ms 1884 KB Output is correct
3 Correct 26 ms 1884 KB Output is correct
4 Correct 39 ms 1884 KB Output is correct
5 Correct 33 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 117 ms 8532 KB Output is correct
2 Correct 131 ms 8284 KB Output is correct
3 Correct 128 ms 8280 KB Output is correct
4 Correct 179 ms 8284 KB Output is correct
5 Correct 164 ms 8280 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 133 ms 8280 KB Output is correct
2 Correct 225 ms 8284 KB Output is correct
3 Correct 131 ms 8284 KB Output is correct
4 Correct 175 ms 8792 KB Output is correct
5 Correct 162 ms 8284 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 140 ms 9816 KB Output is correct
2 Correct 156 ms 9820 KB Output is correct
3 Correct 152 ms 9816 KB Output is correct
4 Correct 213 ms 9836 KB Output is correct
5 Correct 189 ms 9816 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 159 ms 9820 KB Output is correct
2 Correct 263 ms 9836 KB Output is correct
3 Correct 154 ms 10220 KB Output is correct
4 Correct 217 ms 9820 KB Output is correct
5 Correct 191 ms 9844 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 166 ms 11496 KB Output is correct
2 Correct 183 ms 11356 KB Output is correct
3 Correct 179 ms 11408 KB Output is correct
4 Correct 256 ms 11352 KB Output is correct
5 Correct 224 ms 20236 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 186 ms 11356 KB Output is correct
2 Correct 299 ms 11404 KB Output is correct
3 Correct 179 ms 11408 KB Output is correct
4 Correct 249 ms 11352 KB Output is correct
5 Correct 232 ms 21388 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 183 ms 12892 KB Output is correct
2 Correct 214 ms 12972 KB Output is correct
3 Correct 204 ms 12892 KB Output is correct
4 Correct 288 ms 12888 KB Output is correct
5 Correct 266 ms 24092 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 214 ms 12888 KB Output is correct
2 Correct 331 ms 12968 KB Output is correct
3 Correct 204 ms 12892 KB Output is correct
4 Correct 289 ms 12976 KB Output is correct
5 Correct 258 ms 24400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 230 ms 16104 KB Output is correct
2 Correct 269 ms 16208 KB Output is correct
3 Correct 258 ms 16100 KB Output is correct
4 Correct 410 ms 16100 KB Output is correct
5 Correct 325 ms 29652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 267 ms 16108 KB Output is correct
2 Correct 410 ms 15964 KB Output is correct
3 Correct 273 ms 28500 KB Output is correct
4 Correct 366 ms 35408 KB Output is correct
5 Correct 339 ms 31060 KB Output is correct