結果

問題 No.533 Mysterious Stairs
ユーザー JunOnumaJunOnuma
提出日時 2017-06-27 13:39:16
言語 Python2
(2.7.18)
結果
RE  
実行時間 -
コード長 295 bytes
コンパイル時間 717 ms
コンパイル使用メモリ 6,580 KB
実行使用メモリ 228,716 KB
最終ジャッジ日時 2023-07-27 15:09:11
合計ジャッジ時間 8,723 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 10 ms
6,080 KB
testcase_02 AC 11 ms
5,996 KB
testcase_03 AC 11 ms
5,980 KB
testcase_04 AC 11 ms
5,980 KB
testcase_05 AC 11 ms
5,928 KB
testcase_06 AC 11 ms
5,856 KB
testcase_07 AC 11 ms
5,896 KB
testcase_08 AC 11 ms
6,072 KB
testcase_09 AC 11 ms
5,984 KB
testcase_10 AC 11 ms
5,992 KB
testcase_11 AC 11 ms
6,120 KB
testcase_12 AC 12 ms
5,972 KB
testcase_13 AC 11 ms
6,276 KB
testcase_14 AC 12 ms
6,096 KB
testcase_15 AC 12 ms
6,132 KB
testcase_16 AC 15 ms
6,280 KB
testcase_17 AC 18 ms
6,788 KB
testcase_18 AC 21 ms
7,284 KB
testcase_19 AC 24 ms
8,172 KB
testcase_20 AC 160 ms
30,484 KB
testcase_21 AC 184 ms
33,184 KB
testcase_22 AC 616 ms
90,988 KB
testcase_23 AC 1,734 ms
225,980 KB
testcase_24 AC 1,762 ms
228,716 KB
testcase_25 AC 164 ms
30,632 KB
testcase_26 AC 1,471 ms
197,452 KB
testcase_27 AC 376 ms
61,928 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(raw_input())
l = [[0,0,0] for _ in range(n+1)]
l[0][0] = 1
l[1][0] = 1
l[2][1] = 1
for i in range(3,n+1):
    l[i][0] += (l[i-1][1] + l[i-1][2]) % (10**9+7)
    l[i][1] += (l[i-2][0] + l[i-2][2]) % (10**9+7)
    l[i][2] += (l[i-3][0] + l[i-3][1]) % (10**9+7)
print sum(l[n]) % (10**9+7)
0