結果

問題 No.314 ケンケンパ
ユーザー nebukuro09nebukuro09
提出日時 2016-10-28 17:27:00
言語 Python2
(2.7.18)
結果
TLE  
実行時間 -
コード長 237 bytes
コンパイル時間 203 ms
コンパイル使用メモリ 6,912 KB
実行使用メモリ 164,992 KB
最終ジャッジ日時 2024-05-03 07:17:20
合計ジャッジ時間 7,007 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 TLE -
testcase_01 AC 12 ms
6,400 KB
testcase_02 AC 12 ms
6,400 KB
testcase_03 AC 11 ms
6,272 KB
testcase_04 AC 12 ms
6,272 KB
testcase_05 AC 12 ms
6,400 KB
testcase_06 AC 11 ms
6,272 KB
testcase_07 AC 12 ms
6,272 KB
testcase_08 AC 12 ms
6,272 KB
testcase_09 AC 12 ms
6,272 KB
testcase_10 AC 12 ms
6,272 KB
testcase_11 AC 12 ms
6,400 KB
testcase_12 AC 12 ms
6,400 KB
testcase_13 AC 12 ms
6,528 KB
testcase_14 AC 19 ms
7,168 KB
testcase_15 AC 24 ms
7,936 KB
testcase_16 AC 43 ms
10,368 KB
testcase_17 AC 143 ms
21,888 KB
testcase_18 AC 739 ms
82,304 KB
testcase_19 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = input()
dp = [[0 for j in xrange(3)] for i in xrange(N+1)]
MOD = 10**9+7

dp[1][1] = 1
for i in xrange(2, 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[i])%MOD
0