| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 798879 | vjudge1 | Advertisement 2 (JOI23_ho_t2) | C++17 | 137 ms | 8652 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.
#ifdef Home
#define _GLIBCXX_DEBUG
#endif // Home
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
main() {
#ifdef Home
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#endif // Home
ios_base::sync_with_stdio(0);
cin.tie(0);
int n;
cin >> n;
vector < pair < int, int > > V(n);
for(auto &[x, e] : V) {
cin >> x >> e;
}
sort(V.begin(), V.end());
stack < pair < int, int > > st;
for(auto &[x, e] : V) {
if(!st.empty() && x - st.top().first <= st.top().second - e) {
continue;
}
for(; !st.empty() && x - st.top().first <= e - st.top().second; st.pop());
st.push({x, e});
}
cout << st.size();
}
Compilation message (stderr)
| # | 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... | ||||
