結果

問題 No.314 ケンケンパ
ユーザー MitI_7
提出日時 2015-12-13 11:34:11
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 272 ms / 1,000 ms
コード長 267 bytes
コンパイル時間 854 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 10,624 KB
最終ジャッジ日時 2024-09-15 11:34:52
合計ジャッジ時間 2,668 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 17
権限があれば一括ダウンロードができます

ソースコード

diff #

mod = (10 ** 9 + 7)


def main():
    n = int(input())

    zero, one, one_one = 0, 1, 0
    for _ in range(1, n):
        zero, one, one_one = one + one_one % mod, zero % mod, one % mod

    print((zero + one + one_one) % mod)

if __name__ == '__main__':
    main()
0