#25949: MemoryError


hct930924 (老曾不會寫程式)


排列數代10會出現 MemoryError,要如何解決(一直找不到解決方法)

from itertools import permutations
n =  int(input())
l = [str(i) for i in range(1,n+1)]
a = list(permutations(l))
for i in a:
    print(" ".join(i))