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;
#define int long long
pair < int , int > rot(pair < int , int > a){
return {a.first - a.second , a.first + a.second};
}
void solve(){
int n;cin >> n;
pair < int , int > arr[n];
for(int i = 0;i<n;i++){
cin >> arr[i].first >> arr[i].second;
arr[i] = rot(rot(rot(arr[i])));
}
sort(arr , arr + n);
int ans = 0 , miny = 1e18 + 7;
for(int i = 0;i<n;i++){
if(arr[i].second < miny){
miny = arr[i].second;
ans++;
}
}
cout << ans << endl;
}
signed main(){
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int testcase = 1;//cin >> testcase;
while(testcase--)solve();
}
# | 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... |