完美世界,小朋友座位错排,百分之80,就是通不过!!!求助
def f(n): if n == 0: return 0 if n == 1: return 0 if n == 2: return 1 d = [0 for i in range(n + 1)] d[0] = 1 d[1] = 0 d[2] = 1 for i in range(3, n + 1): d[i] = (i - 1) * (d[i - 1] + d[i - 2]) print(d) return d[n] n = int(input()) print(f(n))
错在哪里了?????怎么就只有百分之80!!!! 求大佬指点