結果

問題 No.314 ケンケンパ
ユーザー netyo715netyo715
提出日時 2021-06-28 11:45:16
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 233 ms / 1,000 ms
コード長 222 bytes
コンパイル時間 293 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 171,144 KB
最終ジャッジ日時 2023-09-07 18:21:09
合計ジャッジ時間 3,239 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 233 ms
171,144 KB
testcase_01 AC 73 ms
71,508 KB
testcase_02 AC 74 ms
71,216 KB
testcase_03 AC 72 ms
71,588 KB
testcase_04 AC 73 ms
71,244 KB
testcase_05 AC 73 ms
71,268 KB
testcase_06 AC 73 ms
71,360 KB
testcase_07 AC 72 ms
71,328 KB
testcase_08 AC 71 ms
71,264 KB
testcase_09 AC 73 ms
71,100 KB
testcase_10 AC 72 ms
71,444 KB
testcase_11 AC 72 ms
71,272 KB
testcase_12 AC 72 ms
71,104 KB
testcase_13 AC 72 ms
71,308 KB
testcase_14 AC 77 ms
76,084 KB
testcase_15 AC 77 ms
76,000 KB
testcase_16 AC 78 ms
76,488 KB
testcase_17 AC 80 ms
76,920 KB
testcase_18 AC 150 ms
120,568 KB
testcase_19 AC 231 ms
170,944 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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