結果

問題 No.314 ケンケンパ
ユーザー phtmscgphtmscg
提出日時 2019-04-20 11:48:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 225 bytes
コンパイル時間 215 ms
コンパイル使用メモリ 11,780 KB
実行使用メモリ 49,048 KB
最終ジャッジ日時 2023-10-26 01:43:54
合計ジャッジ時間 2,889 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 406 ms
48,520 KB
testcase_01 AC 25 ms
10,060 KB
testcase_02 AC 25 ms
10,060 KB
testcase_03 AC 25 ms
10,060 KB
testcase_04 RE -
testcase_05 AC 26 ms
10,060 KB
testcase_06 AC 24 ms
10,060 KB
testcase_07 AC 25 ms
10,060 KB
testcase_08 AC 25 ms
10,060 KB
testcase_09 AC 25 ms
10,060 KB
testcase_10 AC 26 ms
10,068 KB
testcase_11 AC 24 ms
10,072 KB
testcase_12 AC 24 ms
10,076 KB
testcase_13 AC 25 ms
10,088 KB
testcase_14 AC 28 ms
10,284 KB
testcase_15 AC 28 ms
10,452 KB
testcase_16 AC 34 ms
10,972 KB
testcase_17 AC 62 ms
13,876 KB
testcase_18 AC 207 ms
28,592 KB
testcase_19 AC 423 ms
49,048 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
dp = [0]*N
for i in range(1,N):
    if i == 1:
        dp[i] = 1
    elif i == 2:
        dp[i] = 1
    else:
        dp[i] = (dp[i-2]+dp[i-3])%(10**9+7)
count = dp[N-1]+dp[N-2]+dp[N-3]
print(count%(10**9+7))
0