๋ฌธ์
https://www.acmicpc.net/problem/2164
ํ์ด
from collections import deque
n,k = map(int,input().split())
queue = deque()
for i in range(1,n+1):
queue.append(i)
print("<",end='')
while queue:
for _ in range(k-1):
queue.append(queue.popleft())
print(queue.popleft(),end="")
if queue:
print(", ",end="")
print(">")
'๐๏ธ Algorithm > ๐ฉ ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[๋ฐฑ์ค] [Python] 4949๋ฒ_๊ท ํ์กํ ์ธ์_์คํ (0) | 2022.10.26 |
---|---|
[๋ฐฑ์ค] [Python] 1966๋ฒ_ํ๋ฆฐํฐ ํ_ํ,๋ฑ (0) | 2022.10.14 |
[๋ฐฑ์ค] [Python] 10773๋ฒ_์ ๋ก_์คํ (1) | 2022.10.13 |
[๋ฐฑ์ค] [Python] 1149๋ฒ_RGB๊ฑฐ๋ฆฌ_๋ค์ด๋๋ฏน ํ๋ก๊ทธ๋๋ฐ (1) | 2022.10.11 |
[๋ฐฑ์ค] [Python] 15650๋ฒ_N๊ณผM(2)_๋ฐฑํธ๋ํน (0) | 2022.10.11 |