[백준/2775/파이썬] 부녀회장이 될테야
소스코드 N = int(input()) for _ in range (N): k = int(input()) n = int(input()) dp = [[i+1 for i in range (n+1)] for j in range(k+1)] for floor in range (1,k+1): for ho in range (1,n+1): dp[floor][ho] = dp[floor-1][ho] + dp[floor][ho-1] print(dp[k][n-1]) 알고리즘 [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15], [1, 3, 6, 10, 15, 21, 28, 36, 45, 55, 66, 78, 91, 105, 120], [1, 4, 10, 20, 35, 56, 84, 1..
[1912/백준/파이썬] 연속합 - DP
소스코드 A = int(input()) numlist = list(map(int,input().split())) for i in range (1,A): numlist[i] = max(numlist[i],numlist[i]+ numlist[i-1]) print(max(numlist)) 알고리즘 numlist= [10 ,-4 ,3 ,1 ,5, 6 ,-35 ,12, 21, -1] 일 때 [10, 6, 3, 1, 5, 6, -35, 12, 21, -1] [10, 6, 9, 1, 5, 6, -35, 12, 21, -1] [10, 6, 9, 10, 5, 6, -35, 12, 21, -1] [10, 6, 9, 10, 15, 6, -35, 12, 21, -1] [10, 6, 9, 10, 15, 21, -35, 12, ..