답안 #232462

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
232462 2020-05-17T06:46:36 Z NONAME Jarvis (COCI19_jarvis) C++17
70 / 70
44 ms 1152 KB
#include <bits/stdc++.h>
#define sz(x) int(x.size())
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)
#define N 100500
#define oo ll(1e16)
#define ft first
#define sd second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define el '\n'
#define elf endl
#define base ll(1e9 + 7)
using namespace std;
typedef long long ll;
typedef long double ld;

int n, a[N];
map <int, int> m;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

//    in("input.txt");

    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> a[i];

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;
        m[x - a[i]]++;
    }

    int ans = 0;

    for (map <int, int> :: iterator it = m.begin(); it != m.end(); it++)
        ans = max(ans, it -> sd);

    cout << ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 384 KB Output is correct
2 Correct 21 ms 768 KB Output is correct
3 Correct 20 ms 768 KB Output is correct
4 Correct 19 ms 768 KB Output is correct
5 Correct 29 ms 768 KB Output is correct
6 Correct 31 ms 896 KB Output is correct
7 Correct 34 ms 768 KB Output is correct
8 Correct 36 ms 768 KB Output is correct
9 Correct 44 ms 1152 KB Output is correct
10 Correct 44 ms 1152 KB Output is correct