Submission #1024275

# Submission time Handle Problem Language Result Execution time Memory
1024275 2024-07-15T22:30:05 Z angels Mobile (BOI12_mobile) C++14
100 / 100
365 ms 35412 KB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    long long int n, L;
    cin>>n>>L;
    vector<pair<long long, long long>>v(n);
    for(int i=0; i<n; i++)
    {
        cin>>v[i].first>>v[i].second;
    }
    double l=1, r=1.5e9;
    while(r-l>1e-3)
    {
        double mid=(l+r)/2;
        double granica=0;
        for(int i=0; i<n; i++)
        {
            double opseg=sqrt(mid*mid-v[i].second*v[i].second);
            double minn=v[i].first-opseg;
            double maxx=v[i].first+opseg;
            if(minn<=granica)
            {
                granica=max(granica, maxx);
            }
        }
        if(granica<L)
        {
            l=mid;
        }
        else
            r=mid;
    }
    cout<<fixed<<setprecision(4)<<l;

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 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 456 KB Output is correct
4 Correct 0 ms 344 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 360 KB Output is correct
2 Correct 1 ms 476 KB Output is correct
3 Correct 1 ms 352 KB Output is correct
4 Correct 1 ms 352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 352 KB Output is correct
2 Correct 1 ms 604 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 2 ms 604 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 1 ms 356 KB Output is correct
4 Correct 2 ms 600 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 352 KB Output is correct
2 Correct 1 ms 608 KB Output is correct
3 Correct 1 ms 600 KB Output is correct
4 Correct 2 ms 856 KB Output is correct
5 Correct 2 ms 352 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 29 ms 2396 KB Output is correct
2 Correct 20 ms 2652 KB Output is correct
3 Correct 12 ms 1884 KB Output is correct
4 Correct 23 ms 2648 KB Output is correct
5 Correct 12 ms 1884 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 20 ms 2392 KB Output is correct
2 Correct 20 ms 2140 KB Output is correct
3 Correct 24 ms 2652 KB Output is correct
4 Correct 25 ms 2656 KB Output is correct
5 Correct 33 ms 3212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 18 ms 2396 KB Output is correct
2 Correct 20 ms 2896 KB Output is correct
3 Correct 20 ms 2652 KB Output is correct
4 Correct 33 ms 3932 KB Output is correct
5 Correct 23 ms 2652 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 3428 KB Output is correct
2 Correct 24 ms 3416 KB Output is correct
3 Correct 22 ms 2908 KB Output is correct
4 Correct 32 ms 3932 KB Output is correct
5 Correct 28 ms 3040 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 24 ms 3428 KB Output is correct
2 Correct 24 ms 3420 KB Output is correct
3 Correct 22 ms 2912 KB Output is correct
4 Correct 35 ms 3932 KB Output is correct
5 Correct 32 ms 3164 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 102 ms 12492 KB Output is correct
2 Correct 118 ms 15952 KB Output is correct
3 Correct 115 ms 15440 KB Output is correct
4 Correct 156 ms 17748 KB Output is correct
5 Correct 139 ms 15056 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 114 ms 16460 KB Output is correct
2 Correct 191 ms 14788 KB Output is correct
3 Correct 110 ms 13900 KB Output is correct
4 Correct 148 ms 17492 KB Output is correct
5 Correct 145 ms 15444 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 120 ms 14928 KB Output is correct
2 Correct 140 ms 19056 KB Output is correct
3 Correct 137 ms 18516 KB Output is correct
4 Correct 200 ms 21588 KB Output is correct
5 Correct 168 ms 17744 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 141 ms 19540 KB Output is correct
2 Correct 223 ms 17516 KB Output is correct
3 Correct 140 ms 16628 KB Output is correct
4 Correct 185 ms 21332 KB Output is correct
5 Correct 170 ms 18416 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 136 ms 17416 KB Output is correct
2 Correct 161 ms 22100 KB Output is correct
3 Correct 160 ms 21328 KB Output is correct
4 Correct 214 ms 24916 KB Output is correct
5 Correct 180 ms 20308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 163 ms 22864 KB Output is correct
2 Correct 245 ms 20560 KB Output is correct
3 Correct 153 ms 19544 KB Output is correct
4 Correct 221 ms 24716 KB Output is correct
5 Correct 192 ms 21328 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 156 ms 19796 KB Output is correct
2 Correct 195 ms 25256 KB Output is correct
3 Correct 200 ms 24488 KB Output is correct
4 Correct 270 ms 28496 KB Output is correct
5 Correct 238 ms 23976 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 215 ms 26140 KB Output is correct
2 Correct 299 ms 23320 KB Output is correct
3 Correct 228 ms 22356 KB Output is correct
4 Correct 277 ms 28328 KB Output is correct
5 Correct 243 ms 24440 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 207 ms 24660 KB Output is correct
2 Correct 259 ms 31568 KB Output is correct
3 Correct 262 ms 30544 KB Output is correct
4 Correct 337 ms 35044 KB Output is correct
5 Correct 304 ms 29664 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 285 ms 32340 KB Output is correct
2 Correct 365 ms 29264 KB Output is correct
3 Correct 279 ms 28240 KB Output is correct
4 Correct 352 ms 35412 KB Output is correct
5 Correct 297 ms 30820 KB Output is correct