제출 #1093078

#제출 시각아이디문제언어결과실행 시간메모리
1093078AbitoStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
183 ms19796 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #define F first #define S second #define pb push_back #define ppb pop_back #define ep insert #define endl '\n' #define elif else if #define pow pwr #define sqrt sqrtt #define int long long #define ll long long typedef unsigned long long ull; using namespace std; const int N=2e5+5; int a[N],n,ans[N]; map<int,int> mp; int32_t main(){ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); cin>>n; for (int i=1;i<=n;i++) cin>>a[i],mp[a[i]]=i; for (int i=1;i<=n;i++){ for (int j=i;j<=mp[a[i]];j++) ans[j]=a[i]; i=mp[a[i]]; } for (int i=1;i<=n;i++) cout<<ans[i]<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...