<백준 문제풀이: 2798번> 블랙잭 - 파이썬
모든 경우의 수를 찾아주기만 하면 된다: import sys N, M = map(int, sys.stdin.readline().split()) cards_list = list(map(int, sys.stdin.readline().split())) sum_list = [] for i in range(len(cards_list)-2): for j in range(i+1, len(cards_list)-1): for k in range(j+1, len(cards_list)): if cards_list[i]+cards_list[j]+cards_list[k] > M: pass else: sum_list.append(cards_list[i]+cards_list[j]+cards_list[k]) print(sorted(..