Submission #493541

# Submission time Handle Problem Language Result Execution time Memory
493541 2021-12-11T22:26:35 Z imaginary_unit Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 16252 KB
#include<bits/stdc++.h>
#define ll long long
#define fi first
#define se second
using namespace std;

ll n, len, x[1'000'000], y[1'000'000];

int main()
{
    scanf("%I64d %I64d", &n, &len);
    for(int i=0; i<n; i++){
        scanf("%I64d %I64d", &x[i], &y[i]);
    }

    double l=1, r=1.5e9;
    while(r-l>1e-3){
        double m=(l+r)/2, cur=0;
        for(int i=0; i<n; i++){
            double delta=sqrt(m*m-y[i]*y[i]);
            double a=x[i]-delta, b=x[i]+delta;
            if(a<=cur){
                cur=max(cur, b);
            }
        }
        if(cur>=len){
            r=m;
        }
        else{
            l=m;
        }
    }
    cout << fixed << setprecision(4) << l;
    return 0;
}

Compilation message

mobile.cpp: In function 'int main()':
mobile.cpp:11:16: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   11 |     scanf("%I64d %I64d", &n, &len);
      |            ~~~~^         ~~
      |                |         |
      |                int*      long long int*
      |            %I64lld
mobile.cpp:11:22: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   11 |     scanf("%I64d %I64d", &n, &len);
      |                  ~~~~^       ~~~~
      |                      |       |
      |                      int*    long long int*
      |                  %I64lld
mobile.cpp:13:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   13 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |                ~~~~^         ~~~~~
      |                    |         |
      |                    int*      long long int*
      |                %I64lld
mobile.cpp:13:26: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   13 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |                      ~~~~^          ~~~~~
      |                          |          |
      |                          int*       long long int*
      |                      %I64lld
mobile.cpp:11:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   11 |     scanf("%I64d %I64d", &n, &len);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
mobile.cpp:13:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 3 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 304 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 6 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 5 ms 308 KB Output is correct
2 Correct 6 ms 332 KB Output is correct
3 Correct 4 ms 332 KB Output is correct
4 Incorrect 8 ms 332 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 85 ms 1512 KB Output is correct
2 Correct 86 ms 1572 KB Output is correct
3 Correct 55 ms 1216 KB Output is correct
4 Incorrect 108 ms 1596 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 77 ms 1700 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 71 ms 1688 KB Output is correct
2 Correct 98 ms 1576 KB Output is correct
3 Correct 92 ms 1876 KB Output is correct
4 Incorrect 170 ms 1956 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 135 ms 1996 KB Output is correct
2 Correct 125 ms 1932 KB Output is correct
3 Correct 105 ms 1996 KB Output is correct
4 Incorrect 174 ms 1968 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 110 ms 2016 KB Output is correct
2 Correct 123 ms 1996 KB Output is correct
3 Correct 106 ms 1984 KB Output is correct
4 Incorrect 169 ms 1972 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 417 ms 8332 KB Output is correct
2 Correct 583 ms 8328 KB Output is correct
3 Correct 548 ms 8332 KB Output is correct
4 Incorrect 824 ms 8316 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 605 ms 8312 KB Output is correct
2 Correct 608 ms 8396 KB Output is correct
3 Correct 524 ms 8300 KB Output is correct
4 Incorrect 829 ms 8420 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 484 ms 9872 KB Output is correct
2 Correct 767 ms 9796 KB Output is correct
3 Correct 688 ms 9892 KB Output is correct
4 Incorrect 991 ms 9844 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 724 ms 9976 KB Output is correct
2 Correct 715 ms 9884 KB Output is correct
3 Correct 597 ms 9884 KB Output is correct
4 Execution timed out 1033 ms 9976 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 571 ms 11432 KB Output is correct
2 Correct 838 ms 11504 KB Output is correct
3 Correct 768 ms 11500 KB Output is correct
4 Execution timed out 1070 ms 11560 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 864 ms 11672 KB Output is correct
2 Correct 847 ms 11460 KB Output is correct
3 Correct 739 ms 11432 KB Output is correct
4 Execution timed out 1078 ms 11428 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 670 ms 12976 KB Output is correct
2 Correct 928 ms 13128 KB Output is correct
3 Correct 893 ms 13224 KB Output is correct
4 Execution timed out 1086 ms 13016 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 989 ms 13024 KB Output is correct
2 Correct 938 ms 12996 KB Output is correct
3 Correct 836 ms 13116 KB Output is correct
4 Execution timed out 1082 ms 12936 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 844 ms 16252 KB Output is correct
2 Execution timed out 1077 ms 14420 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1088 ms 15044 KB Time limit exceeded
2 Halted 0 ms 0 KB -