제출 #311469

#제출 시각아이디문제언어결과실행 시간메모리
311469tevdoreK개의 묶음 (IZhO14_blocks)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
int n, k, ans;
int main() {
    cin >> n >> k;
    for(int i = 1; i < k; i++) ans += a[i];
    ans += a[n];
    cout << ans << "\n";
}

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

blocks.cpp: In function 'int main()':
blocks.cpp:6:39: error: 'a' was not declared in this scope
    6 |     for(int i = 1; i < k; i++) ans += a[i];
      |                                       ^
blocks.cpp:7:12: error: 'a' was not declared in this scope
    7 |     ans += a[n];
      |            ^