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;
typedef long long ll;
int main()
{
ll n;
cin>>n;
map<ll,ll> mapa;
ll cad[n];
for(int i=0; i<n; i++)
{
cin>>cad[i];
mapa[cad[i]]=i;
}
for(int i=0; i<n; i++)
{
ll temp=i;
while(i<mapa[cad[temp]])
{
cad[i]=cad[temp];
i++;
}
}
for(int i=0; i<n; i++)
cout<<cad[i]<<" ";
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |