Skip to content

Commit b404b7a

Browse files
committed
[BOJ] 요세푸스 문제 0 / 실버4 / 18분
1 parent 07590c2 commit b404b7a

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

JYP/요세푸스 문제 0.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
from collections import deque
2+
3+
queue = deque()
4+
answer = []
5+
6+
a, b = map(int, input().split())
7+
8+
for i in range(1, a+1):
9+
queue.append(i)
10+
11+
while queue:
12+
for i in range(b-1):
13+
queue.append(queue.popleft())
14+
answer.append(queue.popleft())
15+
16+
print("<",end='')
17+
for i in range(len(answer)-1):
18+
print("%d, "%answer[i], end='')
19+
print(answer[-1], end='')
20+
print(">")

0 commit comments

Comments
 (0)