Submission #873676

#TimeUsernameProblemLanguageResultExecution timeMemory
873676AlexStone Arranging 2 (JOI23_ho_t1)C++14
35 / 100
39 ms2892 KiB
#include <bits/stdc++.h> #define int long long using namespace std; int32_t main() { int n; cin >> n; int arr[n + 1]; map<int , int >m; vector<int>v; for(int i = 0 ; i< n ; i++){ cin >> arr[i]; if(m[arr[i]] == 0) v.push_back(arr[i]); m[arr[i]] = i; } int cont = 0; for(int i : v){ for(int y = cont ; y < m[i] + 1 ; y++){ cout << i << " "; cont++; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...