求大佬帮忙看看
查看原帖
求大佬帮忙看看
1148509
achilles_wu楼主2023/11/11 11:35
n = int(input())
lst1_one = 1
lst1_two = 2
lst1_three = 0
lst2 = 2
for i in range(2, n):
    lst1_three = lst1_two + lst1_one + lst2
    lst2 = lst1_one * 2 + lst2
    lst1_two, lst1_one = lst1_three, lst1_two
print(lst1_three % 10000)

为什么这样写还是超时

2023/11/11 11:35
加载中...