제출 #1173374

#제출 시각아이디문제언어결과실행 시간메모리
1173374NomioBikeparking (EGOI24_bikeparking)C++20
컴파일 에러
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; }

컴파일 시 표준 에러 (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';
      |                                    ^