제출 #775027

#제출 시각아이디문제언어결과실행 시간메모리
775027vjudge1Stone Arranging 2 (JOI23_ho_t1)C++17
100 / 100
274 ms30760 KiB
#include <bits/stdc++.h> #define ll long long using namespace std; const ll maxn = 1e6 + 7; map<ll,ll> m1; map<ll,ll> m2; ll n, a[maxn]; int main() { cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; if(m1[a[i]] == 0) m1[a[i]] = i; else m2[a[i]] = i; } for(int i = 1; i <= n; i++) { if(m2[a[i]] != 0) { for(int j = i; j <= m2[a[i]]; j++) cout << a[i] << '\n'; i = m2[a[i]] ; } else cout << a[i] << '\n'; } return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...