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>
#define loli long long
using namespace std;
const int lmod = 1e9+7;
int cac[200001];
map<int,int> db;
int main() {
// freopen("input.inp", "r", stdin);
// freopen("output.out", "w", stdout);
int n;
cin >> n;
for(int i = 1;i <= n;i++) {
cin >> cac[i];
db[cac[i]] = i;
}
int lastpos;
for(int i = 1;i <= n;i++) {
lastpos = db[cac[i]];
for(int j = i;j <= lastpos - i + 1;j++){
cout << cac[i] << '\n';
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |