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];
m[arr[i]] = i;
}
int cont = 0;
for(int i = cont ; i < n ; i++){
for(int y = i ; y < m[arr[i]] + 1; y++){
cout << arr[i] << " ";
cont++;
}
i = cont - 1;
}
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |