[백준/Python] 2798번 : 블랙잭
문제
https://www.acmicpc.net/problem/2798
조합을 활용하면 쉽게 풀리는 문제
풀이
파이썬의 itertools를 활용하여 조합을 쉽게 활용할 수 있었다. 조합의 모든 아이템을 순회하며 아이템의 합을 M의 값과 비교하며 가장 근사한 값을 구했다.
from itertools import combinations
N, M = map(int, input().split())
cards = list(map(int, input...
studio-pendant.hashnode.dev1 min read