From 21b50e9c8aff589d6a2d9b3badd1fe8333308459 Mon Sep 17 00:00:00 2001 From: Suanna01 Date: Thu, 6 Apr 2023 14:16:06 +0900 Subject: [PATCH 1/6] =?UTF-8?q?#2=20:=2015649=5FN=EA=B3=BCM(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274M(1).py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "\354\235\264\353\213\210\354\204\261\354\233\220/15649_N\352\263\274M(1).py" diff --git "a/\354\235\264\353\213\210\354\204\261\354\233\220/15649_N\352\263\274M(1).py" "b/\354\235\264\353\213\210\354\204\261\354\233\220/15649_N\352\263\274M(1).py" new file mode 100644 index 0000000..beb2005 --- /dev/null +++ "b/\354\235\264\353\213\210\354\204\261\354\233\220/15649_N\352\263\274M(1).py" @@ -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() + From ae9f427c9396720edaca86f577b671bd1b9b8e67 Mon Sep 17 00:00:00 2001 From: plum-king Date: Thu, 6 Apr 2023 14:16:51 +0900 Subject: [PATCH 2/6] =?UTF-8?q?#2=20:=2015649=5FN=EA=B3=BC=20M(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274M(1).py" | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 "\354\235\264\353\213\210\354\247\200\354\210\230/15649_N\352\263\274M(1).py" diff --git "a/\354\235\264\353\213\210\354\247\200\354\210\230/15649_N\352\263\274M(1).py" "b/\354\235\264\353\213\210\354\247\200\354\210\230/15649_N\352\263\274M(1).py" new file mode 100644 index 0000000..8e61cbe --- /dev/null +++ "b/\354\235\264\353\213\210\354\247\200\354\210\230/15649_N\352\263\274M(1).py" @@ -0,0 +1,6 @@ +from itertools import permutations +n, m = map(int, input().split()) +arr = list(range(1, n+1)) +num = list(permutations(arr, m)) +for i in num: + print(' '.join(map(str,i))) \ No newline at end of file From e8cb0baf6b776edda2e16eb95f06a08b23ad52ab Mon Sep 17 00:00:00 2001 From: leejw-lu Date: Thu, 6 Apr 2023 14:23:51 +0900 Subject: [PATCH 3/6] =?UTF-8?q?#2=20:=2015649=5FN=EA=B3=BC=20M(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274 M(1).py" | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 "\354\235\264\353\213\210\354\247\200\354\232\260/15649_N\352\263\274 M(1).py" diff --git "a/\354\235\264\353\213\210\354\247\200\354\232\260/15649_N\352\263\274 M(1).py" "b/\354\235\264\353\213\210\354\247\200\354\232\260/15649_N\352\263\274 M(1).py" new file mode 100644 index 0000000..95ed01b --- /dev/null +++ "b/\354\235\264\353\213\210\354\247\200\354\232\260/15649_N\352\263\274 M(1).py" @@ -0,0 +1,16 @@ +import itertools + +n, m = map(int, input().split()) +nums = [i for i in range(1, n+1)] +#[1,2,3,4] + +p_array = itertools.permutations(nums, m) +#[(1, 2), (1, 3), (1, 4), (2, 1), (2, 3), (2, 4), (3, 1), (3, 2), (3, 4), (4, 1), (4, 2), (4, 3)] + +#(4, 3) +for i in p_array: + for j in i: + print(j, end = ' ') #4 3 + print() + + From 62699e43e909d42b32af8ef83749e618ff6cf108 Mon Sep 17 00:00:00 2001 From: yjhss <20211420.sungshin.ac.kr> Date: Thu, 6 Apr 2023 14:26:51 +0900 Subject: [PATCH 4/6] =?UTF-8?q?#2=20:=2015649=5FN=EA=B3=BC=20M(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274 M(1).py" | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\234\240\354\247\204/15649_N\352\263\274 M(1).py" diff --git "a/\354\235\264\355\213\260\354\234\240\354\247\204/15649_N\352\263\274 M(1).py" "b/\354\235\264\355\213\260\354\234\240\354\247\204/15649_N\352\263\274 M(1).py" new file mode 100644 index 0000000..9621a29 --- /dev/null +++ "b/\354\235\264\355\213\260\354\234\240\354\247\204/15649_N\352\263\274 M(1).py" @@ -0,0 +1,18 @@ +import itertools +#from itertools import permutations + +n,m = map(int, input().split()) + +a = [] +for i in range(1,n+1): + a.append(i) + +pe = itertools.permutations(a,m) + +#print("hello",end='') +#print(*list(pe)) + +for i in pe: + for j in i: + print(j,end = ' ') + print() \ No newline at end of file From ce8ab7967bdb0bc481484fe603fa380719156461 Mon Sep 17 00:00:00 2001 From: Jiyun Kim Date: Thu, 6 Apr 2023 14:27:06 +0900 Subject: [PATCH 5/6] =?UTF-8?q?#2:=2015649=5FN=EA=B3=BC=20M(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274 M(1).py" | 24 +++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\247\200\354\234\244/15649_N\352\263\274 M(1).py" diff --git "a/\354\235\264\355\213\260\354\247\200\354\234\244/15649_N\352\263\274 M(1).py" "b/\354\235\264\355\213\260\354\247\200\354\234\244/15649_N\352\263\274 M(1).py" new file mode 100644 index 0000000..b2d3e62 --- /dev/null +++ "b/\354\235\264\355\213\260\354\247\200\354\234\244/15649_N\352\263\274 M(1).py" @@ -0,0 +1,24 @@ +#itertools의 permutations 함수를 사용해서 풀어보자. +#permutations(iterable, r) : iterable에서 원소 개수가 r개인 +#순열을 뽑는 것 + +import itertools +#from itertools import permutations + +n, m = map(int, input().split()) # 1부터 n까지 수 안에서 요소가 m개인 순열 만들기 +#nums [ i for i in range(1, n+1)] + +arr = [] +for i in range(n+1): + arr.append(i); +#[1,2,3,4] + + +pe = itertools.permutations(arr,m) #12게 +#[(1,2), (1,3), (1, 4)] + +for i in pe: #12개만큼 반복 + for j in i: + print(j, end=' ') # 1 2 + print() + From d92479d25bea2e2287f6b662327eff190bcc1ec0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=95=88=EC=98=88=EC=9B=90?= <78153914+yewonahn@users.noreply.github.com> Date: Thu, 6 Apr 2023 14:47:12 +0900 Subject: [PATCH 6/6] =?UTF-8?q?#2=20:=2015649=5FN=EA=B3=BCM(1)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../15649_N\352\263\274M(1).py" | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 "\354\235\264\355\213\260\354\230\210\354\233\220/15649_N\352\263\274M(1).py" diff --git "a/\354\235\264\355\213\260\354\230\210\354\233\220/15649_N\352\263\274M(1).py" "b/\354\235\264\355\213\260\354\230\210\354\233\220/15649_N\352\263\274M(1).py" new file mode 100644 index 0000000..52e4bab --- /dev/null +++ "b/\354\235\264\355\213\260\354\230\210\354\233\220/15649_N\352\263\274M(1).py" @@ -0,0 +1,13 @@ +from itertools import permutations +import sys + +print("1부터 N까지 자연수 중에서 중복 없이 M개 선택") + +n, m = map(int, input().split()) +nums = [i for i in range(1, n+1)] + +p_array = permutations(nums, m) +for i in p_array: + for j in i: + print(j, end = " ") + print()