제출 #1078358

#제출 시각아이디문제언어결과실행 시간메모리
1078358lftroqStone Arranging 2 (JOI23_ho_t1)C++14
0 / 100
2061 ms92720 KiB
#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 timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...