답안 #493536

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
493536 2021-12-11T22:04:08 Z imaginary_unit Mobile (BOI12_mobile) C++17
0 / 100
1000 ms 17368 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];

bool ok(double r)
{
    double cur=0;
    for(int i=0; i<n; i++){
        double delta=sqrt(r*r-y[i]*y[i]), a=x[i]-delta, b=x[i]+delta;
        if(a<=cur){
            cur=max(cur, b);
        }
    }
    return cur >= len;
}

double MinRadius(double l, double r)
{
    while(r-l>1e-3){
        double m=(l+r)/2;
        if(ok(m)){
            r=m;
        }
        else{
            l=m;
        }
    }
    return l;
}

int main()
{
    scanf("%I64d %I64d", &n, &len);
    for(int i=0; i<n; i++){
        scanf("%I64d %I64d", &x[i], &y[i]);
    }
    cout << fixed << setprecision(4) << MinRadius(0, 1.5e9);
    return 0;
}

Compilation message

mobile.cpp: In function 'int main()':
mobile.cpp:37:16: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   37 |     scanf("%I64d %I64d", &n, &len);
      |            ~~~~^         ~~
      |                |         |
      |                int*      long long int*
      |            %I64lld
mobile.cpp:37:22: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   37 |     scanf("%I64d %I64d", &n, &len);
      |                  ~~~~^       ~~~~
      |                      |       |
      |                      int*    long long int*
      |                  %I64lld
mobile.cpp:39:20: warning: format '%d' expects argument of type 'int*', but argument 2 has type 'long long int*' [-Wformat=]
   39 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |                ~~~~^         ~~~~~
      |                    |         |
      |                    int*      long long int*
      |                %I64lld
mobile.cpp:39:26: warning: format '%d' expects argument of type 'int*', but argument 3 has type 'long long int*' [-Wformat=]
   39 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |                      ~~~~^          ~~~~~
      |                          |          |
      |                          int*       long long int*
      |                      %I64lld
mobile.cpp:37:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   37 |     scanf("%I64d %I64d", &n, &len);
      |     ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~
mobile.cpp:39:14: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   39 |         scanf("%I64d %I64d", &x[i], &y[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 204 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 332 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 6 ms 432 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 436 KB Output is correct
2 Correct 6 ms 332 KB Output is correct
3 Correct 5 ms 332 KB Output is correct
4 Incorrect 8 ms 460 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 84 ms 2204 KB Output is correct
2 Correct 100 ms 2472 KB Output is correct
3 Correct 54 ms 1612 KB Output is correct
4 Incorrect 107 ms 2300 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 71 ms 2208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 68 ms 2288 KB Output is correct
2 Correct 93 ms 2608 KB Output is correct
3 Correct 89 ms 2248 KB Output is correct
4 Incorrect 162 ms 2820 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 126 ms 2884 KB Output is correct
2 Correct 113 ms 2876 KB Output is correct
3 Correct 93 ms 2484 KB Output is correct
4 Incorrect 166 ms 2916 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 114 ms 2820 KB Output is correct
2 Correct 112 ms 2868 KB Output is correct
3 Correct 96 ms 2432 KB Output is correct
4 Incorrect 164 ms 3012 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 394 ms 9048 KB Output is correct
2 Correct 581 ms 9208 KB Output is correct
3 Correct 545 ms 9120 KB Output is correct
4 Incorrect 818 ms 9244 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 596 ms 9740 KB Output is correct
2 Correct 582 ms 9260 KB Output is correct
3 Correct 512 ms 9156 KB Output is correct
4 Incorrect 823 ms 9168 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 492 ms 10624 KB Output is correct
2 Correct 752 ms 10644 KB Output is correct
3 Correct 665 ms 10732 KB Output is correct
4 Incorrect 991 ms 10788 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 733 ms 11336 KB Output is correct
2 Correct 697 ms 10780 KB Output is correct
3 Correct 578 ms 10764 KB Output is correct
4 Incorrect 979 ms 10880 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 564 ms 12388 KB Output is correct
2 Correct 819 ms 12264 KB Output is correct
3 Correct 756 ms 12364 KB Output is correct
4 Execution timed out 1081 ms 12900 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 847 ms 12848 KB Output is correct
2 Correct 816 ms 12240 KB Output is correct
3 Correct 699 ms 12332 KB Output is correct
4 Execution timed out 1085 ms 12984 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 644 ms 13832 KB Output is correct
2 Correct 902 ms 14240 KB Output is correct
3 Correct 882 ms 13828 KB Output is correct
4 Execution timed out 1073 ms 14340 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 977 ms 14484 KB Output is correct
2 Correct 947 ms 13888 KB Output is correct
3 Correct 838 ms 13848 KB Output is correct
4 Execution timed out 1068 ms 14372 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 826 ms 17368 KB Output is correct
2 Execution timed out 1081 ms 16160 KB Time limit exceeded
3 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 1083 ms 16768 KB Time limit exceeded
2 Halted 0 ms 0 KB -