Submission #873714

#TimeUsernameProblemLanguageResultExecution timeMemory
873714AlexStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
213 ms18836 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]; m[arr[i]] = i; } int cont = 0; for(int i = cont ; i < n ; i++){ for(int y = i ; y < m[arr[i]] + 1; y++){ cout << arr[i] << " "; cont++; } i = cont - 1; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...