Submission #113193

#TimeUsernameProblemLanguageResultExecution timeMemory
113193AbelyanEditor (BOI15_edi)C++17
15 / 100
425 ms2424 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; #define FOR(i,a) for (int i=0;i<(a);++i) #define FORD(i,a) for (int i=(a)-1;i>=0;i--) #define FORT(i,a,b) for (int i=(a);i<=(b);++i) #define FORTD(i,b,a) for (int i=(b);i>=(a);--i) #define trav(i,v) for (auto i : v) #define all(v) v.begin(),v.end() #define ad push_back #define fr first #define sc second #define mpr(a,b) make_pair(a,b) #define pir pair<int,int> #define all(v) v.begin(),v.end() #define make_unique(v) v.erase(unique(all(v),v.end())) #define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); #define dbg(x); #define dbgv(v); #define srng mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()) #define y1 EsiHancagorcRepa #ifdef ALEXPC #define dbg(x); cout<<#x<<" = "<<x<<endl #define dbgv(v); cout<<#v<<" = ["; trav(tv,v)cout<<"tv,";cout<<"]"<<endl #endif //const int N=100,M=N*N; const ll MOD=1000*1000*1000+7; const int N=2*1e6+6,M=6*N,MAXND=N; const ll MX=1000000000ll*1000000000ll; int main(){ fastio; srng; int n; cin>>n; vector<int> v; FOR(i,n){ int t; cin>>t; if (t>0)v.push_back(t); else if(v.size()) v.pop_back(); cout<<v.back()<<endl; } return 0; } /* 3 4 1 2 5 2 3 2 3 1 4 2 3 8 5 2 1 5 2 1 2 2 2 5 2 3 4 2 3 2 */
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...