Skip to content

Commit

Permalink
#2 : 15650_N과 M(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
yjhss committed Apr 12, 2023
1 parent 30a47d3 commit 30ef9f5
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions 이티유진/15650_N과 M(2).py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from itertools import combinations #itertools의 combinations 함수

n,m = map(int, input().split()) # N과 M 입력받기

a = [] # [1,2,3,4 ..]
for i in range(1,n+1):
a.append(i)

for i in combinations(a,m): # a에서 원소 개수 m개인 조합을 뽑는 것, 출력
for j in i:
print(j,end=' ')
print()

0 comments on commit 30ef9f5

Please sign in to comment.