# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
200611 | TadijaSebez | Editor (BOI15_edi) | C++11 | 1099 ms | 3704 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int N=300050;
int a[N];
int main(){
int n,mn=0;
scanf("%i",&n);
for(int i=1;i<=n;i++)scanf("%i",&a[i]),mn=min(mn,a[i]);
for(int i=1;i<=n;i++){
stack<int> stk;
int ans=0;
if(i!=n&&mn>=-1&&n>5000){
for(int j=i;j>=1;j--){
if(stk.size()&&a[j]>stk.top()){
stk.pop();
}else{
if(a[j]>0){ans=a[j];break;}
stk.push(a[j]);
}
}
}
printf("%i\n",ans);
}
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |