Time Exceeded
代码
n = int(input())
temp = [1,2]
for i in range(3,n+1):
temp_length = len(temp)
result = (temp[temp_length-1]+temp[temp_length-2])%(1e9+7)
temp.append(int(result))
print(temp[len(temp)-1])
n = int(input())
temp = [1,2]
for i in range(3,n+1):
temp_length = len(temp)
result = (temp[temp_length-1]+temp[temp_length-2])%(1e9+7)
temp.append(int(result))
print(temp[len(temp)-1])