結果

問題 No.314 ケンケンパ
ユーザー matsu7874matsu7874
提出日時 2015-12-07 00:20:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 170 bytes
コンパイル時間 104 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 47,204 KB
最終ジャッジ日時 2023-10-12 18:33:45
合計ジャッジ時間 2,621 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 365 ms
46,512 KB
testcase_01 AC 15 ms
7,840 KB
testcase_02 AC 15 ms
7,884 KB
testcase_03 AC 15 ms
7,780 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,892 KB
testcase_06 AC 15 ms
7,748 KB
testcase_07 AC 16 ms
7,844 KB
testcase_08 AC 16 ms
7,840 KB
testcase_09 AC 16 ms
7,840 KB
testcase_10 AC 16 ms
7,884 KB
testcase_11 AC 16 ms
7,740 KB
testcase_12 AC 15 ms
7,820 KB
testcase_13 AC 16 ms
7,840 KB
testcase_14 AC 18 ms
8,116 KB
testcase_15 AC 19 ms
8,176 KB
testcase_16 AC 24 ms
9,136 KB
testcase_17 AC 52 ms
12,052 KB
testcase_18 AC 188 ms
26,600 KB
testcase_19 AC 368 ms
47,204 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
dp = [0] * (N + 2)
dp[0] = 1

for i in range(1, N + 2):
    dp[i] = (dp[i - 2] + dp[i - 3]) % 1000000007
print((dp[N] + dp[N-1] + dp[N-2]) % 1000000007)
0