data = [
[0,0,0,0,0,0],
[0,13,11,10,4,7],
[0,13,10,10,8,5],
[0,5,9,7,7,4],
[0,15,12,10,11,5],
[0,10,11,8,8,4]
]
p = [0 for i in range(6)]
f = [0 for i in range(10)]
g = [0 for i in range(10)]
Max = 0
def dfs(step,t):
global Max
for i in range(1,6):
if p[i] == 0:
f[step] = i
p[i] = 1
t += data[step][i]
if step<5:
dfs(step+1,t)
elif t>Max:
Max = t
for j in range(1,6):
g[j] = f[j]
print(g[j],end=" ")
print()
t -= data[step][i]
p[i] = 0
dfs(1,0)
转载请注明原文地址:https://ipadbbs.8miu.com/read-2196.html