-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
yjhss
committed
Apr 12, 2023
1 parent
30a47d3
commit 30ef9f5
Showing
1 changed file
with
12 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |