제출 #1045197

#제출 시각아이디문제언어결과실행 시간메모리
1045197AlebnStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
134 ms18432 KiB
#include <bits/stdc++.h> #define int long long using namespace std; void solve() { int n; cin >> n; vector<int> a(n); map<int,int> mp; for(int i = 0; i < n; i++) { cin >> a[i]; mp[a[i]] = i; } for(int i = 0; i < n; i++) { for(int j = i + 1; j < mp[a[i]]; j++) a[j] = a[i]; i = mp[a[i]]; } for(auto i : a) cout << i << "\n"; } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...