practivceAlgorithm/백준

[백준][Python] 5568 카드놓기

findTheValue 2021. 9. 8. 11:31
import sys
input = sys.stdin.readline
from itertools import permutations

n = int(input())
k = int(input())
cards = [input().rstrip() for _ in range(n)]
# 같은 조합이라도 순서에 따라 다른 수 -> 순열
nums = set()
for num_set in permutations(cards,k):
    nums.add(''.join(num_set))
print(len(nums))

'practivceAlgorithm > 백준' 카테고리의 다른 글

[백준][Python] 1507 궁금한 민호  (0) 2021.09.08
[백준][Python] 16202 MST게임  (0) 2021.09.08
[백준][Python] 10000 원 영역  (0) 2021.09.08
[백준][Python] 10165 버스노선  (0) 2021.09.08
[백준][Python] 2170 선긋기  (0) 2021.09.08