Submission #786102

#TimeUsernameProblemLanguageResultExecution timeMemory
78610212345678Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
281 ms14192 KiB
#include <bits/stdc++.h> using namespace std; int n; int main() { cin.tie(NULL)->sync_with_stdio(false); cin>>n; vector<int> v(n), c(n); map<int, int> m; for (int i=0; i<n; i++) cin>>v[i], m[v[i]]=i; int i=0; while (i<n) { int cl=v[i]; while (i<=m[cl]) c[i]=cl, i++; } for (auto x:c) cout<<x<<'\n'; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...