Submission #775203

#TimeUsernameProblemLanguageResultExecution timeMemory
775203vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
436 ms16356 KiB
#include<bits/stdc++.h> using namespace std; using ll=long long; ll n; ll a[200005]; map<ll,int> mp; int main(){ cin>>n; for(int i=1;i<=n;i++) cin>>a[i]; for(int i=1;i<=n;i++){ mp[a[i]]=i; } int pos; for(int i=1;i<=n;i++){ pos=mp[a[i]]; for(int j=1;j<=pos-i+1;j++){ cout<<a[i]<<endl; } i=pos; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...