Skip to content

Commit fc3f861

Browse files
committed
95차 1번 문제풀이
1 parent 8f1edd1 commit fc3f861

1 file changed

Lines changed: 15 additions & 0 deletions

File tree

live9/test95/문제1/백유진.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
from itertools import permutations
2+
3+
def solution(k, dungeons):
4+
answer = float("-inf")
5+
6+
for dungeon in permutations(dungeons, len(dungeons)):
7+
temp_k = k
8+
max = 0
9+
for min_p, minus_p in dungeon:
10+
if temp_k >= min_p:
11+
temp_k -= minus_p
12+
max += 1
13+
if max > answer:
14+
answer = max
15+
return answer

0 commit comments

Comments
 (0)