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;
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
long long n;
cin >> n;
long long m;
cin >> m;
vector<long long> a(m);
for(long long i = 0 ; i < m ; i++) {
cin >> a[i];
}
vector<long long> b(m);
for(long long i = 0 ; i < m ; i++) {
cin >> b[i];
}
bool one=true;
for(long long i = 0 ; i < m-1 ; i++) {
long long dif1 = abs(a[i]-a[i+1]);
long long dif2 = abs(b[i]-b[i+1]);
if(dif1<dif2) {
one=false;
}
}
if(one) {
cout << 1 << '\n';
} else {
cout << 2 << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |