제출 #1037419

#제출 시각아이디문제언어결과실행 시간메모리
1037419aaaaaarrozAdvertisement 2 (JOI23_ho_t2)C++17
100 / 100
115 ms21176 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { ios_base::sync_with_stdio(0); cin.tie(0); int n; cin >> n; vector<pair<ll, ll>>v; for (int i = 1; i <= n; i++) { ll x, e; cin >> x >> e; v.push_back({ e-x, e + x}); } sort(v.begin(), v.end()); stack<ll>stk; for (int i = 0; i < n; i++) { while (stk.size() && v[i].second >= stk.top()) stk.pop(); stk.push(v[i].second); } cout << stk.size() << "\n"; 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...