제출 #919705

#제출 시각아이디문제언어결과실행 시간메모리
919705AnasAAFStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
171 ms14228 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl '\n' #define float double int main(){ ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); int n;cin>>n; map<int, int>ln; vector<int>v(n); for(int i=0;i<n;i++){ cin>>v[i]; ln[v[i]]=i; } for(int i=0;i<n;i++){ int nm = v[i]; for(int j=i;j<=ln[nm];j++){ v[j]=nm; } i=ln[nm]; } for(int i=0;i<n;i++)cout<<v[i]<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...