답안 #23017

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
23017 2017-05-01T20:32:06 Z arman_ferdous Gap (APIO16_gap) C++14
컴파일 오류
0 ms 0 KB
long long findGap(int T, int N)
{
    long long aray[N], i = 0, j = N-1, lo = 0, hi = MAXN;
    while(j-i >= 1)
    {
        long long x, y;
        MinMax(lo,hi,&x,&y);
        aray[i] = x, aray[j] = y;
        i++, j--;
    }
    
    long long res = -1;
    for(int i = 0; i+1 < N; i++)
        res = (res < aray[i+1]-aray[i] ? aray[i+1]-aray[i] : res);
    return res;
}

Compilation message

gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:3:53: error: 'MAXN' was not declared in this scope
     long long aray[N], i = 0, j = N-1, lo = 0, hi = MAXN;
                                                     ^
gap.cpp:7:27: error: 'MinMax' was not declared in this scope
         MinMax(lo,hi,&x,&y);
                           ^