Submission #774748

#TimeUsernameProblemLanguageResultExecution timeMemory
774748vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
401 ms12444 KiB
#include<bits/stdc++.h> using namespace std; map<int, int> last; int a[200005]; int n; int main() { cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; last[a[i]] = i; } for(int i = 1; i <= n; i++) { int j = last[a[i]]; for(int k = i; k <= j; k++) { cout << a[i] << endl; } i = j; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...