結果

問題 No.639 An Ordinary Sequence
ユーザー R ITSUMIR ITSUMI
提出日時 2020-06-23 00:57:29
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 93 ms / 1,000 ms
コード長 199 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 71,876 KB
最終ジャッジ日時 2023-09-16 19:39:31
合計ジャッジ時間 3,100 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 92 ms
71,608 KB
testcase_01 AC 93 ms
71,724 KB
testcase_02 AC 89 ms
71,524 KB
testcase_03 AC 93 ms
71,564 KB
testcase_04 AC 89 ms
71,580 KB
testcase_05 AC 90 ms
71,572 KB
testcase_06 AC 91 ms
71,520 KB
testcase_07 AC 91 ms
71,724 KB
testcase_08 AC 91 ms
71,484 KB
testcase_09 AC 90 ms
71,716 KB
testcase_10 AC 93 ms
71,580 KB
testcase_11 AC 88 ms
71,824 KB
testcase_12 AC 91 ms
71,584 KB
testcase_13 AC 91 ms
71,496 KB
testcase_14 AC 91 ms
71,576 KB
testcase_15 AC 91 ms
71,876 KB
testcase_16 AC 89 ms
71,356 KB
testcase_17 AC 90 ms
71,524 KB
testcase_18 AC 89 ms
71,520 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
memo = defaultdict(int)
memo[0] = 1
def f(n):
    if memo[n] != 0:
        return memo[n]
    memo[n] = f(n//3) + f(n//5)
    return memo[n]
print(f(int(input())))
0