Skip to content

Commit

Permalink
#2 : 15650_N과 M(2)
Browse files Browse the repository at this point in the history
  • Loading branch information
devCharlotte committed Apr 13, 2023
1 parent 79b802e commit f857ba8
Showing 1 changed file with 19 additions and 3 deletions.
22 changes: 19 additions & 3 deletions 이티준희/15650_N과 M(2).py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
수열은 사전 순으로 증가하는 순서로 출력해야 한다.
'''
import itertools

n,m = map(int,input().split())

'''
#feedback ) combinations 만 사용해도 풀이 가능
from itertools
n,m = map(int,input().split())
num = itertools.combinations([i for i in range(1,n+1)],m)
for i in num :
Expand All @@ -26,4 +28,18 @@
print(" ".join(map(str, k)))
#map k의 요소들을 문자열로 반환
#join 리스트 요소를 문자열로 연결
#" "로 요소 사이에 구분자
#" "로 요소 사이에 구분자
'''
from itertools import combinations

n,m = map(int,input().split())

arr = []
for i in range(1,n+1):
arr.append(i)

for i in combinations(arr,m):
for j in i:
print(j, end=' ')
print()

0 comments on commit f857ba8

Please sign in to comment.