Skip to content

Commit 8125056

Browse files
committed
update: 피로도/YooRiChae.py (주석처리)
1 parent 1840715 commit 8125056

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

[211125] 피로도/YooRiChae.py

+8
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,27 @@
11
from itertools import permutations
22

33
def solution(k, dungeons):
4+
5+
# 조합에 있는 던전 순서대로 다 탐험할 수 있는지
46
def check(now, d_list):
57
for m,c in d_list:
8+
# 못깨면 바로 return
69
if now < m:
710
return False
811
now -=c
912
return True
1013

1114
answer = -1
15+
16+
# 몇개의 던전을 탐험할지..
1217
for n in range(1, len(dungeons)+1):
18+
# 탐험 순서 가져오기
1319
dungeons_list = list(permutations(dungeons, n))
1420
for dungeon in dungeons_list:
21+
# 조합에 있는 던전 순서대로 다 탐험할 수 있는지
1522
if check(k, dungeon):
1623
answer = n
24+
# 탐험할 수 있으면 다음 갯수로
1725
break
1826

1927
return answer

0 commit comments

Comments
 (0)