This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
vector<pair<int, int>> p(n);
for (int i = 0; i < n; i++) {
int X, E;
cin >> X >> E;
p[i] = {E - X, E + X};
}
sort(p.rbegin(), p.rend());
int ans = 0, pref = INT_MIN;
for (auto [a, b] : p) {
ans += b > pref;
pref = max(pref, b);
}
cout << ans << "\n";
}
# | 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... |