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>
using namespace std;
int n, a[200010], lst[200010];
int main() {
cin >> n;
for (int i = 1; i <= n; i++) {
cin >> a[i];
lst[a[i]] = i;
}
for (int i = 1; i <= n; i++) {
for (int j = i; j <= lst[a[i]]; j++) cout << a[i] << endl;
i = lst[a[i]];
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |