제출 #1335612

#제출 시각아이디문제언어결과실행 시간메모리
1335612goulthenBikeparking (EGOI24_bikeparking)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;

#define rep(i,a,b) for (int i = a; i <= b; i++)
#define per(i,a,b) for (int i = a; i >= b; i--)
#define pb push_back
#define all(v) (v).begin(), (v).end()

const int MAXN = 3e5+10;
int a[MAXN], b[MAXN];

int main() {
    ios_base::sync_with_stdio(0);cin.tie(nullptr);
    int n; cin >> n;
    rep(i,1,n) cin >> a[i];
    rep(i,1,n) cin >> b[i];

    cout << (n-2)*a[i] << endl;

    return 0;
}

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

Main.cpp: In function 'int main()':
Main.cpp:18:21: error: 'i' was not declared in this scope
   18 |     cout << (n-2)*a[i] << endl;
      |                     ^