結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 366 ms
46,480 KB
testcase_01 AC 16 ms
7,748 KB
testcase_02 AC 15 ms
7,808 KB
testcase_03 AC 16 ms
7,748 KB
testcase_04 WA -
testcase_05 AC 15 ms
7,744 KB
testcase_06 AC 15 ms
7,940 KB
testcase_07 AC 15 ms
7,776 KB
testcase_08 AC 15 ms
7,760 KB
testcase_09 AC 15 ms
7,740 KB
testcase_10 AC 15 ms
7,744 KB
testcase_11 AC 15 ms
7,808 KB
testcase_12 AC 15 ms
7,736 KB
testcase_13 AC 15 ms
7,856 KB
testcase_14 AC 17 ms
8,256 KB
testcase_15 AC 18 ms
8,372 KB
testcase_16 AC 25 ms
8,984 KB
testcase_17 AC 52 ms
11,860 KB
testcase_18 AC 184 ms
26,780 KB
testcase_19 AC 367 ms
47,196 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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