BOJ/백준-15649-python

cosmos·2022년 10월 4일
0
post-thumbnail

문제

코드

# https://www.acmicpc.net/problem/15649
# boj, 15649: n과 m (1), python3
from itertools import permutations
import sys

input = sys.stdin.readline

def solve(n: int, m: int):
    for x in list(permutations(range(1, n+1), m)):
        print(*x)


if __name__ == '__main__':
    n, m = map(int, input().split())  # (1 ≤ M ≤ N ≤ 8)

    solve(n, m)

결과

출처 & 깃허브

boj 15649
github

0개의 댓글