| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357266 | 12345678 | Advertisement 2 (JOI23_ho_t2) | C++17 | 92 ms | 6392 KiB |
#include <bits/stdc++.h>
using namespace std;
const int nx=5e5+5;
struct info
{
int l, r;
info(int l=0, int r=0): l(l), r(r) {}
bool operator< (const info &o) const {return (r==o.r)?l>o.l:r<o.r;}
} d[nx];
int n, x, e;
int main()
{
cin.tie(NULL)->sync_with_stdio(false);
cin>>n;
for (int i=1; i<=n; i++) cin>>x>>e, d[i]={x-e, x+e};
sort(d+1, d+n+1);
stack<int> s;
for (int i=1; i<=n; i++)
{
while (!s.empty()&&s.top()>=d[i].l) s.pop();
s.push(d[i].l);
}
cout<<s.size();
}| # | 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... | ||||
