Submission #870455

#TimeUsernameProblemLanguageResultExecution timeMemory
870455Marco_EscandonStone Arranging 2 (JOI23_ho_t1)C++11
100 / 100
196 ms18480 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...