제출 #927612

#제출 시각아이디문제언어결과실행 시간메모리
927612koukirocksStone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
183 ms14784 KiB
#include <bits/stdc++.h> #define speed ios_base::sync_with_stdio(0); cin.tie(0) #define all(x) (x).begin(),(x).end() using namespace std; typedef long long ll; typedef long double ldb; typedef pair<int,int> pii; typedef pair<ll,ll> pll; const ll MAX=5e5+10,P=1e9+7; const ll INF=0x3f3f3f3f,oo=0x3f3f3f3f3f3f3f3f; int n; int a[MAX]; map<int,int> last; int main() { speed; cin>>n; for (int i=0;i<n;i++) { cin>>a[i]; last[a[i]]=i; } for (int i=0;i<n;) { for (int j=i;j<=last[a[i]];j++) cout<<a[i]<<"\n"; i=last[a[i]]+1; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...