제출 #1162279

#제출 시각아이디문제언어결과실행 시간메모리
1162279MinhKienGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
long long a[N]; long long findGap(int T, int n) { long long ans = 0; for (int i = 1; i <= n; ++i) { cin >> a[i]; if (i > 1) ans = max(ans, a[i] - a[i - 1]); } return ans; }

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

gap.cpp:1:13: error: 'N' was not declared in this scope
    1 | long long a[N];
      |             ^
gap.cpp: In function 'long long int findGap(int, int)':
gap.cpp:5:5: error: 'cin' was not declared in this scope
    5 |     cin >> a[i];
      |     ^~~
gap.cpp:5:12: error: 'a' was not declared in this scope
    5 |     cin >> a[i];
      |            ^
gap.cpp:6:22: error: 'max' was not declared in this scope
    6 |     if (i > 1) ans = max(ans, a[i] - a[i - 1]);
      |                      ^~~