| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1187801 | nxdxme | Lightning Rod (NOI18_lightningrod) | C++17 | 1095 ms | 30908 KiB |
#include<bits/stdc++.h>
using namespace std;
int n, x, y;
stack<pair<int, int>> st;
int main() {
// cin.tie(nullptr)->sync_with_stdio(false);
cin >> n;
for (int i = 0; i < n; ++i) {
cin >> x >> y;
if (st.empty()) {
st.emplace(x, y);
continue;
}
auto [tx, ty] = st.top();
if (abs(tx - x) <= ty - y) {
continue;
}
while (not st.empty() and abs(x - st.top().first) <= y - st.top().second) {
st.pop();
}
st.emplace(x, y);
}
cout << st.size();
}| # | 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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
