Submission #1173374

#TimeUsernameProblemLanguageResultExecution timeMemory
1173374NomioBikeparking (EGOI24_bikeparking)C++20
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); int n; cin >> n; int a[n], b[n]; for(int i = 0; i < n; i++) { cin >> a[i]; } for(int i = 0; i < n; i++) { cin >> b[i]; } cout << max(0, (n - 2) * a[i]) << '\n'; return 0; }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:15:36: error: 'i' was not declared in this scope
   15 |         cout << max(0, (n - 2) * a[i]) << '\n';
      |                                    ^