제출 #802948

#제출 시각아이디문제언어결과실행 시간메모리
802948aymanrsAdvertisement 2 (JOI23_ho_t2)C++14
100 / 100
120 ms14032 KiB
#include<bits/stdc++.h> const int MOD = 1e9+7; using namespace std; void solve(){ vector<pair<int, int>> v; int n, x, e; cin >> n; while(n--){ cin >> x >> e; v.emplace_back(e+x, e-x); } sort(v.begin(), v.end()); int ans = 0; while(!v.empty()){ ans++; e = v.back().second; v.pop_back(); while(!v.empty() && v.back().second <= e) v.pop_back(); } cout << ans << '\n'; } int main(){ ios_base::sync_with_stdio(false); cin.tie(0); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...