Home > other >  Entering the algorithm pit, brush of the first problem is encountered, the Fibonacci sequence proble
Entering the algorithm pit, brush of the first problem is encountered, the Fibonacci sequence proble

Time:10-07


As shown in figure, the upper limit is 1 million, the last time I estimate must measure 1 million, is a timeout
The code is as follows:
 f1=1 
F2=1
List_1=[f1, f2]

For I in range (2, int (input ())) :
List_1 list_1 [0], [1]=list_1 list_1 [0] + [1], list_1 [0]

Print (list_1 [0] % 10007)

Baidu is no any code in python,,,
Dalao they teach me how to improve orz

CodePudding user response:

Blogger is not in accordance with the specification, can try to take more than sum again

CodePudding user response:

reference 1/f, stay hungry * reply:
bloggers write according to the specification, can try to take more than sum again
because I did not , I can't imagine how to implement doesn't count for remainder directly

CodePudding user response:

  • Related