Skip to content

Commit

Permalink
Merge pull request #65 from AlgoLeadMe/origin/15-2secondag
Browse files Browse the repository at this point in the history
15-2secondag
  • Loading branch information
2secondag authored Mar 4, 2024
2 parents 0ceee9a + 1dd6c5a commit 9e20445
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
8 changes: 8 additions & 0 deletions 2secondag/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,4 +12,12 @@
| 8차시 | 2024.01.22 | 구현 | [단어 공부] (https://www.acmicpc.net/problem/1157) | [#31](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/31#event-11604202172)|
| 9차시 | 2024.01.25 | 수학 | [달팽이는 올라가고 싶다] (https://www.acmicpc.net/problem/2869) | [#37](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/37#event-11619409875)|
| 10차시 | 2024.01.28 | 구현 | [음계] (https://www.acmicpc.net/problem/2920) | [#39](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/39#event-11655882785)|
<<<<<<< Updated upstream
=======
<<<<<<< Updated upstream
| 11차시 | 2024.01.31 | 부루트포스 알고리즘 | [블랙잭] (https://www.acmicpc.net/problem/2798) | [#46]()|
| 12차시 | 2024.02.15 | 스택 | [스택] (https://www.acmicpc.net/problem/10828) | [#58](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/58)|
| 13차시 | 2024.02.18 | 브루트포스 | [체스판 다시 칠하기] (https://www.acmicpc.net/problem/1018) | [#62](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/62)|
| 14차시 | 2024.02.21 | 자료구조 | [수 찾기] (https://www.acmicpc.net/problem/1920) | [#63](https://github.com/AlgoLeadMe/AlgoLeadMe-5/pull/63#issuecomment-1962366605)|
>>>>>>> Stashed changes
17 changes: 17 additions & 0 deletions 2secondag/자료구조/요세푸스 문제.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import sys

N, K = map(int, sys.stdin.readline().split())
people = []

for i in range(1,N+1):
people.append(i)

result = []


index = 0
for i in range(1, N + 1):
index = (index + K - 1) % len(people)
result.append(people.pop(index))

print("<" + ", ".join(map(str, result)) + ">")

0 comments on commit 9e20445

Please sign in to comment.