선릉역 1번 출구
baekjoon - 2161 본문
백준 2161 - 카드1
https://www.acmicpc.net/problem/2161
from collections import deque n = int(input()) card = deque([ i for i in range(n, 0, -1)]) pop_card = [] while len(card) > 1: pop_card.append(card.pop()) card.appendleft(card.pop()) pop_card.append(card.pop()) print(" ".join(map(str, pop_card))) |
'Algorithm > Algorithm 문제풀이' 카테고리의 다른 글
baekjoon - 2605 (0) | 2021.10.03 |
---|---|
baekjoon - 11866 (0) | 2021.10.03 |
baekjoon - 15886 (0) | 2021.10.03 |
baekjoon - 14467 (0) | 2021.10.03 |
baekjoon - 15500 (0) | 2021.10.03 |
Comments