結果

問題 No.44 DPなすごろく
ユーザー convexineqconvexineq
提出日時 2020-12-03 07:53:05
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 75 ms / 5,000 ms
コード長 216 bytes
コンパイル時間 1,090 ms
コンパイル使用メモリ 86,724 KB
実行使用メモリ 71,204 KB
最終ジャッジ日時 2023-10-11 16:45:18
合計ジャッジ時間 3,492 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,204 KB
testcase_01 AC 72 ms
70,988 KB
testcase_02 AC 73 ms
71,064 KB
testcase_03 AC 73 ms
71,068 KB
testcase_04 AC 73 ms
71,096 KB
testcase_05 AC 73 ms
71,168 KB
testcase_06 AC 75 ms
71,148 KB
testcase_07 AC 74 ms
70,748 KB
testcase_08 AC 72 ms
71,064 KB
testcase_09 AC 72 ms
71,164 KB
testcase_10 AC 73 ms
70,876 KB
testcase_11 AC 71 ms
70,752 KB
testcase_12 AC 71 ms
71,052 KB
testcase_13 AC 73 ms
71,168 KB
testcase_14 AC 72 ms
70,868 KB
testcase_15 AC 72 ms
71,056 KB
testcase_16 AC 71 ms
71,196 KB
testcase_17 AC 73 ms
71,060 KB
testcase_18 AC 72 ms
71,096 KB
testcase_19 AC 74 ms
71,200 KB
testcase_20 AC 74 ms
70,960 KB
testcase_21 AC 72 ms
70,756 KB
testcase_22 AC 72 ms
71,088 KB
testcase_23 AC 72 ms
71,084 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Your code here!
import sys
read = sys.stdin.read
readline = sys.stdin.readline

n = int(readline())
dp = [0]*(n+3)
dp[0] = 1
for i in range(n):
    dp[i+1] += dp[i]
    dp[i+2] += dp[i]
print(dp[n])
0