제출 #42342

#제출 시각아이디문제언어결과실행 시간메모리
42342minhtung0404라멘 (JOI14_ramen)C++14
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

typedef pair <int, int> ii;

ii solve(int l, int r){
    if (l == r) return ii(l, l);
    if (l + 1 == r){
        if (Compare(l, r) == 1) return ii(r, l);
        else return ii(l, r);
    }
    ii a = solve(l + 2, r), ans;
    if (Compare(l, l+1) == 1) {
        ans.first = l+1; ans.second = l;
    }
    else{
        ans.first = l; ans.second = l+1;
    }
    if (Compare(ans.first, a.first) == 1) ans.first = a.first;
    if (Compare(a.second, ans.second) == 1) ans.second = a.second;
    return ans;
}

void Ramen(int N) {
    ii a = solve(0, N-1);
	Answer(a.first, a.second);
}

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

ramen.cpp: In function 'ii solve(int, int)':
ramen.cpp:9:25: error: 'Compare' was not declared in this scope
         if (Compare(l, r) == 1) return ii(r, l);
                         ^
ramen.cpp:13:23: error: 'Compare' was not declared in this scope
     if (Compare(l, l+1) == 1) {
                       ^
ramen.cpp:19:35: error: 'Compare' was not declared in this scope
     if (Compare(ans.first, a.first) == 1) ans.first = a.first;
                                   ^
ramen.cpp:20:37: error: 'Compare' was not declared in this scope
     if (Compare(a.second, ans.second) == 1) ans.second = a.second;
                                     ^
ramen.cpp: In function 'void Ramen(int)':
ramen.cpp:26:26: error: 'Answer' was not declared in this scope
  Answer(a.first, a.second);
                          ^