제출 #942061

#제출 시각아이디문제언어결과실행 시간메모리
942061Alexabcde1Stone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
445 ms18516 KiB
#include<bits/stdc++.h> #define f first #define s second using namespace std; long long n,i,j; long long a[200005]; map<long long,long long> m; int main(){ ios::sync_with_stdio(false); cin.tie(0); cout.tie(0); cin>>n; for (i=1;i<=n;i++){ cin>>a[i]; m[a[i]]=i; } for (i=1;i<=n;i++){ for (j=i;j<=m[a[i]];j++) a[j]=a[i]; i=m[a[i]]; } for (i=1;i<=n;i++) cout<<a[i]<<endl; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...