제출 #919649

#제출 시각아이디문제언어결과실행 시간메모리
919649Younis_DwaiAdvertisement 2 (JOI23_ho_t2)C++14
59 / 100
2027 ms6224 KiB
#include <bits/stdc++.h> //#define int long long #define ll long long #define in insert #define F first #define S second #define pb push_back #define endl "\n" #define mid (l+r)/2 #define pop pop_back //#define all(v) v.begin(),v.end() using namespace std; const int M=998244353; int n,ans=0; multiset<pair<int,int>> s; int32_t main(){ ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n; for(int i=1;i<=n;i++){ int X,E;cin>>X>>E; s.in({E,X}); } while(!s.empty()){ ans++; pair<int,int> x=*prev(s.end()); vector<pair<int,int>> v; for(auto u : s){ if(abs(u.S-x.S)<=x.F-u.F) v.pb(u); } for(auto u : v) s.erase(s.find(u)); } cout<<ans; 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...