Submission #888210

#TimeUsernameProblemLanguageResultExecution timeMemory
888210ace5Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
307 ms15452 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int64_t a[n]; map<int,int> ls; for(int i = 0;i < n;++i) { cin >> a[i]; ls[a[i]] = i+1; } for(int i = 0;i < n;++i) { if(ls[a[i]] > i) { for(int j = i;j < ls[a[i]];++j) { cout << a[i] << "\n"; } i = ls[a[i]]-1; } else { cout << a[i] << "\n"; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...