제출 #895701

#제출 시각아이디문제언어결과실행 시간메모리
895701Richw818Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
125 ms14492 KiB
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); int n; cin >> n; map<int, int> inds; vector<int> a(n); for (int i = 0; i < n; i++) { cin >> a[i]; inds[a[i]] = i; } for (int i = 0; i < n; i++) { int to = inds[a[i]]; for (int j = i + 1; j < to; j++) { a[j] = a[i]; } i = to; } for (int i = 0; i < n; i++) { cout << a[i] << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...