제출 #1339424

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

int main () {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    int n;
    cin >> n;

    vector<int> a(n + 1), b(n + 1);
    map<int, int> f;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i]; f[a[i] - b[i]]++;

    int mx = 0;
    for (auto [x, y] : f) mx = max(mx, x);

    cout << mx << "\n";
    return 0;
}

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

jarvis.cpp: In function 'int main()':
jarvis.cpp:14:51: error: 'i' was not declared in this scope
   14 |     for (int i = 1; i <= n; i++) cin >> b[i]; f[a[i] - b[i]]++;
      |                                                   ^