제출 #1162280

#제출 시각아이디문제언어결과실행 시간메모리
1162280MinhKienGap (APIO16_gap)C++20
컴파일 에러
0 ms0 KiB
const int N = 1e5 + 10; 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: In function 'long long int findGap(int, int)':
gap.cpp:6:5: error: 'cin' was not declared in this scope
    6 |     cin >> a[i];
      |     ^~~
gap.cpp:7:22: error: 'max' was not declared in this scope
    7 |     if (i > 1) ans = max(ans, a[i] - a[i - 1]);
      |                      ^~~