제출 #1094065

#제출 시각아이디문제언어결과실행 시간메모리
1094065vjudge1Advertisement 2 (JOI23_ho_t2)C++14
100 / 100
114 ms19144 KiB
#include<iostream> #include<cstdio> #include<algorithm> using namespace std; const int N=500005; int n,x[N],e[N],b[N],q[N],tot; pair<int,int> a[N]; int main() { ios::sync_with_stdio(false); cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;i++) { cin>>x[i]>>e[i]; a[i]=make_pair(e[i]-x[i],x[i]+e[i]); } sort(a+1,a+1+n); for(int i=1;i<=n;i++) { while(tot&&a[q[tot]].second<=a[i].second)tot--; q[++tot]=i; } cout<<tot<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...