제출 #341769

#제출 시각아이디문제언어결과실행 시간메모리
341769blueGap (APIO16_gap)C++11
컴파일 에러
0 ms0 KiB
#include "gap.h"
using namespace std;

long long findGap(int T, int N)
{
    if(T == 1)
    {
        long long s, t;
        long long mn, mx;

        s = 0;
        t = 1000000000000000000 LL;

        long long res = 0;
        findGap(s, t, &mn, &mx);
        s = mn+1;
        t = mx-1;
        while(1)
        {
            findGap(s, t, &mn, &mx);
            if(mn == -1) return res;
            res = max(res, s-mn, mx-t);
            s = mn+1;
            t = mx-1;
        }
    }

    return -1;
}

컴파일 시 표준 에러 (stderr) 메시지

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:12:32: error: expected ';' before 'LL'
   12 |         t = 1000000000000000000 LL;
      |                                ^~~
      |                                ;
gap.cpp:15:31: error: too many arguments to function 'long long int findGap(int, int)'
   15 |         findGap(s, t, &mn, &mx);
      |                               ^
gap.cpp:4:11: note: declared here
    4 | long long findGap(int T, int N)
      |           ^~~~~~~
gap.cpp:20:35: error: too many arguments to function 'long long int findGap(int, int)'
   20 |             findGap(s, t, &mn, &mx);
      |                                   ^
gap.cpp:4:11: note: declared here
    4 | long long findGap(int T, int N)
      |           ^~~~~~~
gap.cpp:22:19: error: 'max' was not declared in this scope; did you mean 'mx'?
   22 |             res = max(res, s-mn, mx-t);
      |                   ^~~
      |                   mx