Skip to content

Commit 4955a35

Browse files
authored
Create 15650_N과 M(2).py
1 parent 4b83916 commit 4955a35

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

이티예원/15650_N과 M(2).py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
n = int(input())
2+
num = list(range(1, n))
3+
m = int(input())
4+
5+
't번째 자리'
6+
7+
result=[]
8+
def pick(t):
9+
for a in range(n-m+1):
10+
if t != 1 and result != []:
11+
if result[t-2] < num[t-1+a]:
12+
result.append(num[t-1+a])
13+
if t<m:
14+
pick(t+1)
15+
elif t == m:
16+
print (*result, "\n")
17+
del result[m-1]
18+
if t >= 2:
19+
del result[t-2]
20+
21+
pick(1)

0 commit comments

Comments
 (0)