#include <bits/stdc++.h>
using namespace std;
int n;
int A[100005];
map<int,int> bucket;
typedef pair<int,int> pii;
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);
cin>>n;
for(int i=0;i<n;i++){
cin>>A[i];
}
for(int i=0;i<n;i++){
int B;
cin>>B;
int diff=B-A[i];
bucket[diff]++;
}
pii maximum=make_pair(0,0);
for(pii p: bucket){
if(p.second>maximum.second){
maximum=p;
}
}
cout<<maximum.second<<'\n';
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
384 KB |
Output is correct |
2 |
Correct |
20 ms |
1152 KB |
Output is correct |
3 |
Correct |
21 ms |
1152 KB |
Output is correct |
4 |
Correct |
21 ms |
1152 KB |
Output is correct |
5 |
Correct |
30 ms |
2300 KB |
Output is correct |
6 |
Correct |
35 ms |
2168 KB |
Output is correct |
7 |
Correct |
36 ms |
2168 KB |
Output is correct |
8 |
Correct |
35 ms |
2176 KB |
Output is correct |
9 |
Correct |
45 ms |
2552 KB |
Output is correct |
10 |
Correct |
47 ms |
2552 KB |
Output is correct |