Submission #311469

# Submission time Handle Problem Language Result Execution time Memory
311469 2020-10-10T11:11:07 Z tevdore K blocks (IZhO14_blocks) C++14
Compilation error
0 ms 0 KB
#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";
}

Compilation message

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];
      |            ^