| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1359798 | chiiu | Lightning Rod (NOI18_lightningrod) | C++20 | 1098 ms | 152280 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.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});
}
sort(v.begin(), v.end());
for(int i = 0; i < n; ++i){
int x = v[i].first;
int y = v[i].second;
int l = x - y;
int r = x + y;
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... | ||||
