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;
int main()
{
int n; cin>>n;
map<int,int>m;
int a[n],ans[n]; for(int i=0;i<n;i++) cin>>a[i],ans[i]=0,m[a[i]]=i;
for(int i=0;i<n;i++)
{
for(int j=i;j<=m[a[i]];j++) ans[j]=a[i];
i=m[a[i]];
}
for(int i=0;i<n;i++) cout<<ans[i]<<endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |