# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
120945 | kimbj0709 | Jarvis (COCI19_jarvis) | C++17 | 82 ms | 3372 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int no_of_input;
int input;
vector<int> vect1;
vector<int> vect2;
vector<int> vect3;
cin >> no_of_input;
for(int i=0;i<no_of_input;i++){
cin >> input;
vect1.push_back(input);
}
for(int i=0;i<no_of_input;i++){
cin >> input;
vect2.push_back(input);
}
for(int i=0;i<no_of_input;i++){
vect3.push_back(vect1[i]-vect2[i]);
}
sort(vect3.begin(),vect3.end());
int rn = vect3[0];
int counter = 1;
int maximum = 0;
for(int i=1;i<vect3.size();i++){
if(vect3[i]==rn){
counter++;
}
else{
maximum = max(maximum,counter);
counter = 1;
rn = vect3[i];
}
}
maximum = max(maximum,counter);
cout << maximum;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |