#include <bits/stdc++.h>
using namespace std;
void solve() {
int n;
cin >> n;
vector<array<int, 2>> a(n);
for (auto &i: a) {
int x, e;
cin >> x >> e;
i = {x-e, -(x+e)};
}
// solve
sort(begin(a), end(a));
int max = -1, cnt = 0;
for (auto &i: a) if (max < -i[1]) max = -i[1], cnt++;
// ans
cout << cnt << '\n';
}
signed main() {
cin.tie(0)->sync_with_stdio(0);
solve();
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |