제출 #1078360

#제출 시각아이디문제언어결과실행 시간메모리
1078360lftroqStone Arranging 2 (JOI23_ho_t1)C++14
100 / 100
183 ms14552 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[a[i]]+1) for(int j=i;j<=ne[a[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...