| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1359835 | chiiu | Lightning Rod (NOI18_lightningrod) | C++20 | 1033 ms | 152180 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
int n; cin >> n;
vector<pair<int, int>> st, v;
st.reserve(n);
for (int i = 0; i < n; ++i) {
int x, y; cin >> x >> y;
v.push_back({x, y});
}
for(int i = 0; i < n; ++i){
int l = v[i].first - v[i].second;
int r = v[i].first + v[i].second;
while (!st.empty() && l <= st.back().first) {
st.pop_back();
}
if (!st.empty() && r <= st.back().second) {
continue;
}
st.push_back({l, r});
}
cout << st.size() << "\n";
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... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
