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 endl '\n'
#define fi first
#define se second
using namespace std;
typedef long long ll;
const int N=200005;
int a[N];
map<int,int> ne;
void solve()
{
int n;
cin >> n;
for(int i=1;i<=n;i++)
{
cin >> a[i];
ne[a[i]]=i;
}
for(int i=1;i<=n;i=ne[i]+1) for(int j=i;j<=ne[i];j++) cout << a[i] << ' ';
}
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
solve();
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... |