This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <map>
using namespace std;
const int nmax = 2e5 + 7;
map<int, int> ult;
int v[nmax];
int main() {
int n;
cin >> n;
for(int i = 1; i <= n; i ++) {
cin >> v[i];
ult[v[i]] = i;
}
int i = 1;
while(i <= n) {
int val = v[i];
while(i <= ult[val]) {
v[i] = val;
i ++;
}
}
for(int i = 1; i <= n; i ++) {
cout << v[i] << '\n';
}
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |