| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1037065 | juicy | Advertisement 2 (JOI23_ho_t2) | C++17 | 120 ms | 14276 KiB |
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;
#ifdef LOCAL
#include "debug.h"
#else
#define debug(...) 42
#endif
int main() {
ios::sync_with_stdio(false); cin.tie(nullptr);
int n;
cin >> n;
vector<array<int, 2>> pt;
for (int i = 1; i <= n; ++i) {
int a, b; cin >> a >> b;
pt.push_back({a + b, b - a});
}
sort(pt.rbegin(), pt.rend());
int res = 0;
int mx = -2e9;
for (auto [x, y] : pt) {
if (y > mx) {
++res;
mx = y;
}
}
cout << res;
return 0;
}
// lmfao| # | 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... | ||||
