๋ฌธ์
https://www.acmicpc.net/problem/15654
ํ์ด
# ๋ฐฑ์ค 15654๋ฒ ๋ฌธ์ - N๊ณผ M(5)
from itertools import permutations
n, m = map(int, input().split())
new_list = list(map(int, input().split()))
new_list = sorted(new_list) #์์๋๋ก ๋์ค๊ฒ ์ ๋ ฌ ๋จผ์
for numbers in list(permutations(new_list, m)):
for num in numbers:
print(num, end=' ')
print()
'๐๏ธ Algorithm > ๐ฉ ๋ฐฑ์ค' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
๐ฉ [๋ฐฑ์ค] [Python] [Gold3] 1520๋ฒ_๋ด๋ฆฌ๋ง ๊ธธ (0) | 2023.04.19 |
---|---|
๐ฉ [๋ฐฑ์ค] [Python] [Silver1] 1991๋ฒ_ํธ๋ฆฌ ์ํ (0) | 2023.04.19 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold3] 2206๋ฒ_๋ฒฝ ๋ถ์๊ณ ์ด๋ํ๊ธฐ (0) | 2023.04.17 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold4] 1753๋ฒ_์ต๋จ๊ฒฝ๋ก (0) | 2023.04.16 |
๐ฉ [๋ฐฑ์ค] [Python] [Gold4] 9663๋ฒ_N-Queen (0) | 2023.04.15 |