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<bits/stdc++.h>
using namespace std;
const int maxn = 2e5 + 5;
map<int,int> d;
int main() {
int n;
cin >> n;
map<int,int> d;
int a[maxn];
for(int i = 1;i <= n;i++) {
cin >> a[i];
d[a[i]] = i;
}
int check;
for(int i = 1; i <= n;i++) {
check = d[a[i]];
for(int j = 1; j <= check - i + 1; j++){
cout << a[i] << endl;
}
i = check;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |