結果
| 問題 | No.639 An Ordinary Sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-02-20 17:50:02 |
| 言語 | Python3 (3.14.3 + numpy 2.4.2 + scipy 1.17.0) |
| 結果 |
AC
|
| 実行時間 | 97 ms / 1,000 ms |
| コード長 | 229 bytes |
| 記録 | |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 20,700 KB |
| 実行使用メモリ | 15,356 KB |
| 最終ジャッジ日時 | 2026-03-18 22:14:03 |
| 合計ジャッジ時間 | 3,662 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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))