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>
#define ll long long
#define fi first
#define se second
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int N;
cin >> N;
vector<int>X(N+1);
vector<int>Y(N+1);
int lrd1=0;
bool sub1 = true;
for(int i=1; i<=N; i++) {
cin >> X[i] >> Y[i];
if(Y[i]!=1) sub1=false;
if(i>1 && X[i]!=X[i-1]) lrd1++;
}
lrd1++;
if(sub1) {
cout << lrd1 << endl;
return 0;
} else
if(N==2) {
if((abs(X[1]-X[2]) <= Y[1]-Y[2]) || (abs(X[2]-X[1]) <= Y[2]-Y[1])) {
cout << "1" << endl;
} else {
cout << "2" << endl;
}
return 0;
}
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... |