DP를 적용한 코드 for tc in range(int(input())): n, m = map(int, input().split()) array = list(map(int, input().split())) dp = [] index = 0 for i in range(n): dp.append(array[index:index + m]) index += m # print(dp) for j in range(1, m): for i in range(n): if i == 0: left_up = 0 else: left_up = dp[i-1][j-1] if i == n-1: left_down = 0 else: left_down = dp[i+1][j-1] left = dp[i][j-1] dp[i][j] = dp[i][j] ..
[이취코] 금광 (Python3)
DP를 적용한 코드 for tc in range(int(input())): n, m = map(int, input().split()) array = list(map(int, input().split())) dp = [] index = 0 for i in range(n): dp.append(array[index:index + m]) index += m # print(dp) for j in range(1, m): for i in range(n): if i == 0: left_up = 0 else: left_up = dp[i-1][j-1] if i == n-1: left_down = 0 else: left_down = dp[i+1][j-1] left = dp[i][j-1] dp[i][j] = dp[i][j] ..
2024.03.06