Submission #921424

#TimeUsernameProblemLanguageResultExecution timeMemory
921424Abdalaziz_AlshamiStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
432 ms15700 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...