Submission #311469

#TimeUsernameProblemLanguageResultExecution timeMemory
311469tevdoreK blocks (IZhO14_blocks)C++14
Compilation error
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"; }

Compilation message (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];
      |            ^