結果

問題 No.314 ケンケンパ
ユーザー syunsukesyunsuke
提出日時 2019-04-22 23:49:44
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 237 bytes
コンパイル時間 93 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 144,128 KB
最終ジャッジ日時 2024-04-20 09:17:56
合計ジャッジ時間 7,157 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 30 ms
10,752 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 30 ms
10,880 KB
testcase_07 AC 29 ms
10,880 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 31 ms
10,880 KB
testcase_11 AC 31 ms
10,752 KB
testcase_12 AC 31 ms
10,752 KB
testcase_13 AC 31 ms
11,008 KB
testcase_14 AC 38 ms
11,520 KB
testcase_15 AC 44 ms
12,032 KB
testcase_16 AC 63 ms
14,208 KB
testcase_17 AC 166 ms
24,192 KB
testcase_18 AC 735 ms
74,624 KB
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

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