-
[백준 문제풀이] 얼렁뚱땅 2629번 양팔저울 풀이얼렁뚱땅 백준 문제풀이 2022. 5. 16. 20:39
으앙 너무어려워 너무어려워
너무어려워!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
https://www.acmicpc.net/problem/2629 n = int(input()) gram = list(map(int,input().split())) m = int(input()) circle = list(map(int,input().split())) dp = [[0] * 15001 for _ in range(n+1)] possible = [] def calculation(left, right, num) : new = abs(left-right) if new not in possible: possible.append(new) if num == n : return 0 if dp[num][new] == 0 : calculation(left+gram[num], right, num+1) calculation(left, right+gram[num], num+1) calculation(left, right, num+1) dp[num][new] = 1 calculation(0,0,0) for i in range(len(circle)) : if circle[i] in possible : print('Y', end= ' ') else : print('N', end = ' ')
사실 아직도 이해안된 부분도 있다.. 하ㅏㅏ;..
'얼렁뚱땅 백준 문제풀이' 카테고리의 다른 글
[백준 문제풀이] 얼렁뚱땅 20057번 마법사 상어와 토네이도 풀이 (0) 2022.05.17 [백준 문제풀이] 얼렁뚱땅 2056번 작업 풀이 (0) 2022.05.16 [백준 문제풀이] 얼렁뚱땅 6159번 코스튬파티 풀이 (0) 2022.05.16 [백준 문제풀이] 얼렁뚱땅 20436 zoac3 풀이 (0) 2022.04.30 [백준 문제풀이] 얼렁뚱땅 1531번 투명 풀이 (0) 2022.04.30