| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1363939 | edo | Advertisement 2 (JOI23_ho_t2) | C++20 | 86 ms | 8260 KiB |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
vector<pair<ll, ll>> seg(n);
for (int i = 0; i < n; ++i) {
ll x, e;
cin >> x >> e;
seg[i] = {x - e, x + e};
}
sort(seg.begin(), seg.end(), [&](auto x, auto y) {
return (x.first == y.first ? x.second > y.second : x.first < y.first);
});
ll mx = -(1ll << 60), ans = 0;
for (auto [l, r] : seg) {
if (r > mx) {
mx = r;
ans++;
}
}
cout << ans;
return 0;
}
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
