# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200043 | wilwxk | Lightning Rod (NOI18_lightningrod) | C++14 | 2071 ms | 131800 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.
#include <bits/stdc++.h>
using namespace std;
vector<pair<int, int> > st;
int n;
int main() {
scanf("%d", &n);
for(int i = 1; i <= n; i++) {
int a, b; scanf("%d %d", &a, &b);
if(st.size() && a-st.back().first <= abs(b-st.back().second) && st.back().second >= b) continue;
while(st.size() && a-st.back().first <= abs(b-st.back().second)) st.pop_back();
st.push_back({a, b});
}
printf("%d\n", int(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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |