restructure zeta/** to storage/zeta/**
This commit is contained in:
10
storage/zeta/py/completed/15654.py
Normal file
10
storage/zeta/py/completed/15654.py
Normal file
@@ -0,0 +1,10 @@
|
||||
N, M = map(int, input().split())
|
||||
trace = [(sorted(list(map(int, input().split()))), M, [])]
|
||||
|
||||
while trace:
|
||||
n, m, d = trace.pop()
|
||||
for i in range(len(n) - 1, -1, -1):
|
||||
trace.append((n[:i] + n[i + 1:], m - 1, d + [n[i]]))
|
||||
if m == 0:
|
||||
print(" ".join(map(str, d)))
|
||||
# 아마도 백트래킹일거임 아마도 그럼 ㅇㅇ
|
||||
Reference in New Issue
Block a user