제출 #774713

#제출 시각아이디문제언어결과실행 시간메모리
774713vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
181 ms12440 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long typedef vector<int> vi; typedef vector<vi> vvi; map<int,int> M; int main(){ int n; cin>>n; vector<int> v(n+1); for(int i=1;i<=n;++i){ cin>>v[i]; M[v[i]] = i; } int ptr = 1; while(ptr<=n){ int last = M[v[ptr]]; for(int i = ptr;i<=last;++i){ v[i] = v[ptr]; } ptr = last+1; } for(int i=1;i<=n;++i){ cout<<v[i]<<'\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...