結果

問題 No.314 ケンケンパ
ユーザー todo_2marikotodo_2mariko
提出日時 2019-03-13 15:19:04
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
RE  
実行時間 -
コード長 192 bytes
コンパイル時間 574 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 9,152 KB
最終ジャッジ日時 2023-09-05 20:35:20
合計ジャッジ時間 1,526 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 AC 19 ms
8,640 KB
testcase_02 AC 21 ms
8,608 KB
testcase_03 WA -
testcase_04 AC 20 ms
8,584 KB
testcase_05 AC 19 ms
8,556 KB
testcase_06 AC 20 ms
8,636 KB
testcase_07 AC 20 ms
8,584 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from functools import lru_cache


n = int(input())

@lru_cache(maxsize=1000000)
def kp(n):
    if n< 3:
        return n
    else:
        return kp(n-1) + kp(n-2)//2



print(kp(n)%(10**9+7))
0