結果
| 問題 |
No.639 An Ordinary Sequence
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-20 17:50:02 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 1,000 ms |
| コード長 | 229 bytes |
| コンパイル時間 | 177 ms |
| コンパイル使用メモリ | 12,416 KB |
| 実行使用メモリ | 10,752 KB |
| 最終ジャッジ日時 | 2024-06-29 10:54:14 |
| 合計ジャッジ時間 | 1,523 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 17 |
ソースコード
N = int(input())
from collections import defaultdict
d = defaultdict(lambda:-1)
d[0] = 1
def f(x):
if d[x] != -1:
return d[x]
s = x//3
t = x//5
d[x] = f(s) + f(t)
return d[x]
print(f(N))