답안 #440437

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
440437 2021-07-02T09:17:51 Z sam571128 밀림 점프 (APIO21_jumps) C++17
컴파일 오류
0 ms 0 KB
#include "jumps.h"

#include <bits/stdc++.h>

void init(int N, std::vector<int> H) {

}

int minimum_jumps(int A, int B, int C, int D) {
    return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
}

Compilation message

jumps.cpp: In function 'int minimum_jumps(int, int, int, int)':
jumps.cpp:10:21: error: 'a' was not declared in this scope
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |                     ^
jumps.cpp:10:23: error: 'd' was not declared in this scope
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |                       ^
jumps.cpp:10:32: error: 'c' was not declared in this scope
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |                                ^
jumps.cpp:10:39: error: 'b' was not declared in this scope
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |                                       ^
jumps.cpp:10:44: error: 'abc' was not declared in this scope; did you mean 'abs'?
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |                                            ^~~
      |                                            abs
jumps.cpp:10:12: error: 'min' was not declared in this scope; did you mean 'std::min'?
   10 |     return min({abs(a-d),abs(a-c),abs(b-c),abc(b-d)});
      |            ^~~
      |            std::min
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from jumps.cpp:3:
/usr/include/c++/10/bits/stl_algo.h:3474:5: note: 'std::min' declared here
 3474 |     min(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~