| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1357543 | nezuko2410 | Lightning Rod (NOI18_lightningrod) | C++20 | 917 ms | 159088 KiB |
#include<bits/stdc++.h>
using namespace std;
long long x,y,l,r,n,i;
stack<pair<long long,long long>>st;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cin>>n;
for(i=1; i<=n; i++) {
cin>>x>>y;
l=y-x;
r=y+x;
bool kt=1;
while(!st.empty()) {
auto t=st.top();
if(t.first<=l && t.second<=r)
st.pop();
else if(t.first>=l && t.second>=r){
kt=0;
break;
}
else
break;
}
if(kt)
st.push({l,r});
}
cout<<st.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... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
