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;
using ll=long long;
ll n;
ll a[200005];
map<ll,int> mp;
int main(){
cin>>n;
for(int i=1;i<=n;i++) cin>>a[i];
for(int i=1;i<=n;i++){
mp[a[i]]=i;
}
int pos;
for(int i=1;i<=n;i++){
pos=mp[a[i]];
for(int j=1;j<=pos-i+1;j++){
cout<<a[i]<<endl;
}
i=pos;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |