[파이썬] 백준 12869 : 뮤탈리스크 (골드4)
[파이썬] 백준 12869 : 뮤탈리스크 (골드4)https://www.acmicpc.net/problem/12869풀이방향성 생각바텀업보다는 탑다운이 짜기 더 쉬워보인다.전체코드import syssys.setrecursionlimit(10**6)N = int(input())HP = list(map(int,input().split()))for _ in range(3-N): HP.append(0)dp = {}def dfs(a,b,c): # 재방문 if (a,b,c) in dp: return dp[(a,b,c)] # 탈출조건 if (a,b,c) == (0,0,0): return 0 answer = min(dfs(max(a-9,0),max(b-3,0),..
2024. 6. 8.