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 MAX_N = 200000;
int N;
int A[MAX_N];
map<int, int> mpa;
int main(){
cin.tie(0);
cout.tie(0);
ios::sync_with_stdio(false);
cin >> N;
for(int i = 0; i < N; i++){
cin >> A[i];
mpa[A[i]] = i;
}
for(int i = 0; i < N; i++){
if(mpa.count(A[i]) == 0){
cout << A[i] << endl;
}else{
int num = A[i];
int num2 = mpa[A[i]];
for(; i <= num2; i++){
cout << num << endl;
}
i--;
}
}
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... |