
10. 다이나믹 프로그래밍(바닥 공사)
·
Python/알고리즘(Python)
# 바닥 공사 n = int(input()) d = [0] * (n+1) d[1] = 1 d[2] = 3 for i in range(3,n+1): d[i] = 2*d[i-2] + d[i-1] print(d[n] % 796796) Uploaded by Notion2Tistory v1.1.0