Disclaimer: This article is a blogger original article, follow the CC 4.0 BY-SA copyright agreement, reproduced, please attach the original source link and this statement.
Xiao Ming just learning computer programming, the teacher gave him such a title, but what he was thinking, are usually do not, therefore, had to consult experts of you.
Seeking sum = 1! +2! +3! + ...... + late 6788! +6789! 5-position. Submit format: SimCTF {}
Recursion depth is too large, rely on this to control:
import sys
sys.setrecursionlimit(200000)
Code:
import sys
sys.setrecursionlimit(200000)
def digui(n):
if n==1:
return 1
else:
return n*digui(n-1)
l=[]
for i in range(1,25):
print(str(i)+':'+str(digui(i)))
l.append(digui(i))
print(l)
print(sum(l))
At first, I was silly to let him calculate. Later found to be less reliable. To be a long time before.
Then we see people say, you can calculate in front of 24 friends. I began to try.
So this is the rule:
before 24:
the top 30:
the back of the digits do not change it. It seems, good at math is powerful. In conclusion!