Submission #759088

#TimeUsernameProblemLanguageResultExecution timeMemory
759088Dan4LifeStone Arranging 2 (JOI23_ho_t1)C++17
35 / 100
40 ms1844 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = (int)2e5+10; int n, i, a[mxN], mx[mxN]; int main() { cin >> n; for(i = 0; i < n; i++) cin >> a[i], mx[a[i]]=i; i=0; while(i<n){ int x = a[i]; while(i<n and mx[x]>=i) cout<<x<<"\n",i++; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...