Submission #151396

#TimeUsernameProblemLanguageResultExecution timeMemory
151396cfalasEditor (BOI15_edi)C++14
15 / 100
944 ms4028 KiB
#include<bits/stdc++.h> using namespace std; int main(){ int n; cin>>n; stack<int> st; st.push(0); for(int i=0;i<n;i++){ int a; cin>>a; if(a<0) st.pop(); else st.push(a); cout<<st.top()<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...