#include <bits/stdc++.h>
using namespace std;
int main() {
int n; cin >> n;
int arrA[n], arrB[n];
vector<int> vec;
map<int, int> mp;
for(int i = 0; i < n; i++)
cin >> arrA[i];
for(int i = 0; i < n; i++){
cin >> arrB[i];
int diff = arrB[i] - arrA[i];
mp[diff]++;
vec.push_back(diff);
}
sort(vec.begin(), vec.end(), [&](int a, int b){
return mp[a] > mp[b];
});
cout << mp[vec[0]] << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
61 ms |
1788 KB |
Output is correct |
3 |
Correct |
62 ms |
1828 KB |
Output is correct |
4 |
Correct |
59 ms |
1820 KB |
Output is correct |
5 |
Correct |
83 ms |
1828 KB |
Output is correct |
6 |
Correct |
97 ms |
1820 KB |
Output is correct |
7 |
Correct |
123 ms |
1720 KB |
Output is correct |
8 |
Correct |
124 ms |
1820 KB |
Output is correct |
9 |
Correct |
317 ms |
2112 KB |
Output is correct |
10 |
Correct |
315 ms |
2076 KB |
Output is correct |