結果

問題 No.314 ケンケンパ
ユーザー pluto77pluto77
提出日時 2016-04-12 09:52:31
言語 Python2
(2.7.18)
結果
AC  
実行時間 319 ms / 1,000 ms
コード長 177 bytes
コンパイル時間 48 ms
コンパイル使用メモリ 7,040 KB
実行使用メモリ 38,144 KB
最終ジャッジ日時 2024-04-15 00:36:42
合計ジャッジ時間 3,040 ms
ジャッジサーバーID
(参考情報)
judge4 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 319 ms
37,760 KB
testcase_01 AC 62 ms
14,208 KB
testcase_02 AC 58 ms
14,208 KB
testcase_03 AC 60 ms
14,080 KB
testcase_04 AC 61 ms
14,208 KB
testcase_05 AC 58 ms
14,208 KB
testcase_06 AC 59 ms
14,208 KB
testcase_07 AC 56 ms
14,080 KB
testcase_08 AC 61 ms
14,080 KB
testcase_09 AC 58 ms
14,208 KB
testcase_10 AC 57 ms
14,208 KB
testcase_11 AC 60 ms
14,080 KB
testcase_12 AC 62 ms
14,208 KB
testcase_13 AC 59 ms
14,208 KB
testcase_14 AC 59 ms
14,208 KB
testcase_15 AC 62 ms
14,208 KB
testcase_16 AC 68 ms
14,592 KB
testcase_17 AC 87 ms
16,512 KB
testcase_18 AC 180 ms
25,472 KB
testcase_19 AC 316 ms
38,144 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#coding: utf-8
##yuki_314

n=int(raw_input())

dp=[0 for i in xrange(1000001)]

dp[0]=1
dp[1]=2
dp[2]=2
for i in xrange(3,n):
 dp[i]=(dp[i-2]+dp[i-3])%(10**9+7)
 
print dp[n-1]
0