| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 774651 | vjudge1 | Stone Arranging 2 (JOI23_ho_t1) | C++17 | 1 ms | 212 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define st first
#define nd second
signed main(){
cin.tie(0)->sync_with_stdio(0);
int n;
cin >> n;
int a[n + 1];
for(int i = 1; i <= n ; i++)
cin >> a[i];
int ans[n + 1];
int ptr = n, tmp = n - 1;
ans[n] = a[n];
while(ptr >= 1){
while(a[tmp] != a[ptr] && tmp >= 1){
ans[tmp] = ans[ptr];
tmp--;
}
ans[tmp] = ans[ptr];
ptr = tmp - 1;
ans[ptr] = a[ptr];
tmp = ptr - 1;
}
for(int i = 1 ; i <= n ; i++)
cout << ans[i] << endl;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
