| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 798792 | vjudge1 | Stone Arranging 2 (JOI23_ho_t1) | C++17 | 2083 ms | 259832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);cout.tie(0);
int n;
cin >> n;
map<int, vector<int>> st;
int a[n];
for(int i = 0; i < n; i++) {
cin >> a[i];
if(st[a[i]].empty()) st[a[i]].push_back(i);
else {
int lst = st[a[i]].back();
for(int j = i - 1; j > lst; j--)
st[a[j]].pop_back();
while(lst < i) {
a[++lst] = a[i];
st[a[lst]].push_back(lst);
}
}
}
for(int i = 0; i < n; i++)
cout << a[i] << '\n';
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
