結果

問題 No.44 DPなすごろく
ユーザー brthyyjpbrthyyjp
提出日時 2020-10-22 15:55:55
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 117 bytes
コンパイル時間 309 ms
コンパイル使用メモリ 86,924 KB
実行使用メモリ 71,656 KB
最終ジャッジ日時 2023-09-28 14:37:31
合計ジャッジ時間 3,478 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,448 KB
testcase_01 AC 74 ms
71,584 KB
testcase_02 AC 73 ms
71,060 KB
testcase_03 AC 74 ms
71,416 KB
testcase_04 AC 74 ms
71,388 KB
testcase_05 AC 74 ms
71,512 KB
testcase_06 AC 74 ms
71,104 KB
testcase_07 AC 74 ms
71,552 KB
testcase_08 AC 75 ms
71,304 KB
testcase_09 AC 74 ms
71,268 KB
testcase_10 AC 73 ms
71,428 KB
testcase_11 AC 74 ms
71,096 KB
testcase_12 AC 73 ms
71,324 KB
testcase_13 AC 75 ms
71,656 KB
testcase_14 AC 74 ms
71,504 KB
testcase_15 AC 75 ms
71,108 KB
testcase_16 AC 76 ms
71,412 KB
testcase_17 AC 75 ms
71,560 KB
testcase_18 AC 75 ms
71,556 KB
testcase_19 AC 76 ms
71,372 KB
testcase_20 AC 73 ms
71,224 KB
testcase_21 AC 73 ms
71,272 KB
testcase_22 AC 74 ms
71,272 KB
testcase_23 AC 75 ms
71,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
dp = [0]*(n+1)
dp[0] = 1
dp[1] = 1
for i in range(2, n+1):
    dp[i] = dp[i-1]+dp[i-2]
print(dp[n])
0