結果

問題 No.639 An Ordinary Sequence
ユーザー rlangevinrlangevin
提出日時 2023-01-30 08:53:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 21 ms / 1,000 ms
コード長 192 bytes
コンパイル時間 636 ms
コンパイル使用メモリ 10,644 KB
実行使用メモリ 8,676 KB
最終ジャッジ日時 2023-09-12 12:04:29
合計ジャッジ時間 1,980 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 20 ms
8,460 KB
testcase_01 AC 21 ms
8,648 KB
testcase_02 AC 20 ms
8,676 KB
testcase_03 AC 20 ms
8,620 KB
testcase_04 AC 20 ms
8,532 KB
testcase_05 AC 20 ms
8,616 KB
testcase_06 AC 20 ms
8,472 KB
testcase_07 AC 19 ms
8,544 KB
testcase_08 AC 20 ms
8,572 KB
testcase_09 AC 20 ms
8,540 KB
testcase_10 AC 21 ms
8,488 KB
testcase_11 AC 20 ms
8,488 KB
testcase_12 AC 20 ms
8,440 KB
testcase_13 AC 20 ms
8,500 KB
testcase_14 AC 20 ms
8,568 KB
testcase_15 AC 20 ms
8,568 KB
testcase_16 AC 21 ms
8,572 KB
testcase_17 AC 20 ms
8,424 KB
testcase_18 AC 21 ms
8,664 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(10**7)
from functools import lru_cache

@lru_cache(maxsize=None)
def f(x):
    if x == 0:
        return 1
    return f(x//3) + f(x//5)

print(f(int(input())))
0