제출 #987319

#제출 시각아이디문제언어결과실행 시간메모리
987319lucriEditor (BOI15_edi)C++17
28 / 100
84 ms5452 KiB
#include <bits/stdc++.h> using namespace std; long long n,v[300010]; stack<int>s; int main() { cin>>n; for(int i=1;i<=n;++i) cin>>v[i]; for(int i=1;i<n;++i) cout<<1<<'\n'; for(int i=n;i>=0;--i) { if(s.empty()&&v[i]>=0) { cout<<v[i]<<'\n'; return 0; } if(!s.empty()&&v[i]>s.top()) s.pop(); else s.push(v[i]); } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...