This commit is contained in:
2023-06-06 21:46:42 +10:00
parent 03e5096f10
commit 0949fd6ff9
2 changed files with 20 additions and 0 deletions

View File

@@ -0,0 +1,4 @@
C 0.002s 1
JS 0.064s 32
Py3 0.070s 35
Toy 0.430s 215

View File

@@ -0,0 +1,16 @@
import sys
sys.setrecursionlimit(11000)
#the test case (python)
def test_sum(key: int, val: int):
def sum(n: int):
if n < 2:
return n
return n + sum(n - 1)
result: int = sum(val)
print(str(key) + ": " + str(result))
for i in range(0, 10):
test_sum(i, i * 1000)