제출 #774707

#제출 시각아이디문제언어결과실행 시간메모리
774707vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
60 / 100
2065 ms17884 KiB
#include <bits/stdc++.h> using namespace std; #define ll long long #define dbg(x) cout << (#x) << " = " << x << endl const ll maxn = 2e5 + 69; ll a[maxn],b[maxn],n; map<ll,ll> cnt; int main(){ cin >> n; for(int i = 1;i<=n;i++){ cin >> a[i]; b[i] = a[i]; if(cnt[a[i]] == 0){ cnt[a[i]] = i; }else{ //dbg(a[i]); for(int j = cnt[a[i]];j<=i;j++){ b[j] = a[i]; cnt[a[j]] = 0; } cnt[a[i]] = 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...