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 int long long
using namespace std;
int32_t main()
{
int n;
cin >> n;
int arr[n + 1];
map<int , int >m;
vector<int>v;
for(int i = 0 ; i< n ; i++){
cin >> arr[i];
if(m[arr[i]] == 0)
v.push_back(arr[i]);
m[arr[i]] = i;
}
int cont = 0;
for(int i : v){
for(int y = cont ; y < m[i] + 1 ; y++){
cout << i << " ";
cont++;
}
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |