Submission #901164

#TimeUsernameProblemLanguageResultExecution timeMemory
901164SuPythonyStone Arranging 2 (JOI23_ho_t1)C++17
25 / 100
2041 ms2064 KiB
#include <bits/stdc++.h> using namespace std; int main() { int n; cin>>n; vector<int> cols; for (int i=0; i<n; i++) { int c; cin>>c; if (find(cols.begin(), cols.end(), c)!=cols.end()) { auto it=cols.end()-1; while (*it!=c&&it>cols.begin()) { *it=c; it--; } } cols.push_back(c); } for (int i: cols) cout<<i<<"\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...