Run ID 作者 问题 语言 测评结果 Time Memory 代码长度 提交时间
68235 金浩 小明养猪的故事 Python3 Wrong Answer 38 MS 3760 KB 189 2024-03-21 11:09:45

Tests(0/1):


Code:

def f(x): if x==1 or x==2 or x==3: return x else: return 2*f(x-1)-f(x-2)+f(x-3) T=int(input()) for i in range(T): N=int(input()) a=f(N) print(a)


Run Info:

------Input------
17 1 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
------Answer-----
1 5 8 13 21 34 55 89 144 233 377 610 987 1597 2584 4181 6765
------Your output-----
1 5 9 16 28 49 86 151 265 465 816 1432 2513 4410 7739 13581 23833