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 <iostream>
#include <map>
#include <vector>
using namespace std;
int v[200000];
map<int,int> frv;
vector<int> rasp;
int main()
{
int n,i,poz,npoz;
cin>>n;
for(i=0;i<n;i++){
cin>>v[i];
frv[v[i]]=i;
}
poz=0;
while(poz!=n){
npoz=frv[v[poz]]+1;
for(i=poz;i<npoz;i++) rasp.push_back(v[poz]);
poz=npoz;
}
for(i=0;i<n;i++){
cout<<rasp[i]<<"\n";
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |