Submission #759090

#TimeUsernameProblemLanguageResultExecution timeMemory
759090Dan4LifeStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
210 ms14336 KiB
#include <bits/stdc++.h> using namespace std; const int mxN = (int)2e5+10; int n, i, a[mxN]; map<int,int> mx; 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...