Submission #361710

#TimeUsernameProblemLanguageResultExecution timeMemory
361710wildturtleLightning Rod (NOI18_lightningrod)C++14
66 / 100
2082 ms98912 KiB
#include<bits/stdc++.h> using namespace std; long long a,b,c,d,i,e,f,g,n,m,k,l; stack < pair <long long , long long > > st; int main() { cin>>n; for(long long i=1;i<=n;i++) { cin>>a>>b; l=0; while(!st.empty()) { c=st.top().first; d=st.top().second; if(a+b<=c+d) { l=1; break; } if(a-b<=c-d) st.pop(); else break; } if(l==0) st.push({a,b}); } cout<<st.size(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...