제출 #774692

#제출 시각아이디문제언어결과실행 시간메모리
774692vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
0 / 100
0 ms284 KiB
#include<bits/stdc++.h> using namespace std; #define ll long long int a[2001], b[2001]; map<int,int> mp; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n; cin>>n; for(int i=1; i<=n; i++){ cin>>a[i]; mp[a[i]]++; } for(int i=1; i<=n; i++){ b[i]=a[i]; if(mp[a[i]]>=2){ int j=i; i++; while(a[i]!=a[j]){ b[i]=a[j]; mp[a[i]]--; i++; } mp[a[j]]-=2; } b[i]=a[i]; } for(int i=1; i<=n; i++){ cout<<b[i]<<endl; } }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...