Skip to content

Commit

Permalink
#2 : 15649_N과M(1)
Browse files Browse the repository at this point in the history
  • Loading branch information
Suanna01 committed Apr 6, 2023
1 parent cc1e975 commit 21b50e9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions 이니성원/15649_N과M(1).py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import sys
import itertools
n,m=map(int,sys.stdin.readline().split()) #map(적용시킬 함수, 적용할 값들) : 입력받은 값을 정수타입으로 변환
nums=[i for i in range(1,n+1)] #i = 1 ~ n

arr=itertools.permutations(nums, m) #permutations(iterable, r) : iterable에서 원소개수가 r개인 순열 뽑기
# print(list(arr))

for i in arr:
for j in i:
print(j,end=" ")
print()

0 comments on commit 21b50e9

Please sign in to comment.