Submission #96618

# Submission time Handle Problem Language Result Execution time Memory
96618 2019-02-10T13:08:38 Z Ort Jarvis (COCI19_jarvis) C++11
70 / 70
34 ms 5112 KB
#include<iostream>

using namespace std;

int a[100005], b[100005], freqpos[2000005], freqneg[2000005];

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n; cin >> n;
    for(int i=0;i<n;i++) cin >> a[i];
    for(int i=0;i<n;i++) cin >> b[i];
    for(int i=0;i<n;i++) {
    	if(a[i]>=b[i]) freqpos[a[i]-b[i]]++;
    	else freqneg[b[i]-a[i]]++;
	}
	int sol = 0;
	for(int i=0;i<2000004;i++) sol = max(sol, freqpos[i]);
 	for(int i=0;i<2000004;i++) sol = max(sol, freqneg[i]); 
	cout << sol;
    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 8 ms 376 KB Output is correct
2 Correct 21 ms 1144 KB Output is correct
3 Correct 21 ms 1144 KB Output is correct
4 Correct 34 ms 1144 KB Output is correct
5 Correct 29 ms 1144 KB Output is correct
6 Correct 29 ms 1144 KB Output is correct
7 Correct 30 ms 1528 KB Output is correct
8 Correct 29 ms 1528 KB Output is correct
9 Correct 32 ms 5112 KB Output is correct
10 Correct 33 ms 5040 KB Output is correct