제출 #774670

#제출 시각아이디문제언어결과실행 시간메모리
774670vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
223 ms14032 KiB
#include<bits/stdc++.h> using namespace std; map<int,int> mp; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int n; cin>>n; vector<int> a; a.resize(n+2); for(int i=1;i<=n;++i) { cin>>a[i]; mp[a[i]]=i; } for(int i=1;i<=n;++i) { if(mp[a[i]]==0) { cout<<a[i]<<"\n"; } else { for(int j=i;j<=mp[a[i]];++j) { cout<<a[i]<<"\n"; } i=mp[a[i]]; } } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...