답안 #17598

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
17598 2016-01-02T03:52:21 Z Namnamseo 라멘 (JOI14_ramen) C++14
컴파일 오류
0 ms 0 KB
int a[1024];
int b[1024];

void Ramen (int n){
    int i, ind=0;
    for(i=0;i*2+1<n;++i){
        if(Compare(i*2,i*2+1)==1){
            a[ind]=i*2; b[ind]=i*2+1;
        } else {
            a[ind]=i*2+1; b[ind]=i*2;
        }
        ++ind;
    }
    if(n&1) a[ind]=b[ind]=n-1, ++ind;
    int M=a[0], m=b[0];
    for(i=1;i<ind;++i){
        if(Compare(M,a[i])==-1) M=a[i];
        if(Compare(b[i],m)==-1) m=b[i];
    }
    Answer(m,M);
}

Compilation message

ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:7:29: error: 'Compare' was not declared in this scope
         if(Compare(i*2,i*2+1)==1){
                             ^
ramen.cpp:17:26: error: 'Compare' was not declared in this scope
         if(Compare(M,a[i])==-1) M=a[i];
                          ^
ramen.cpp:18:26: error: 'Compare' was not declared in this scope
         if(Compare(b[i],m)==-1) m=b[i];
                          ^
ramen.cpp:20:15: error: 'Answer' was not declared in this scope
     Answer(m,M);
               ^