제출 #742112

#제출 시각아이디문제언어결과실행 시간메모리
7421121075508020060209tcAdvertisement 2 (JOI23_ho_t2)C++14
100 / 100
487 ms11108 KiB
#include <bits/stdc++.h> using namespace std; #define int long long #define X first #define Y second int mod=998244353; int n; pair<int,int>ar[500005]; signed main() { cin>>n; for(int i=1;i<=n;i++){ int x;int y; cin>>x>>y; ar[i].X=x-y; ar[i].Y=x+y; ar[i].Y*=-1; } sort(ar+1,ar+n+1); for(int i=1;i<=n;i++){ ar[i].Y*=-1; } int ans=n; int mxh=ar[1].Y; for(int i=2;i<=n;i++){ if(ar[i].Y<=mxh){ ans--; } mxh=max(mxh,ar[i].Y); } cout<<ans<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...