結果

問題 No.2416 vs Slime
ユーザー NakLon131
提出日時 2023-08-12 13:59:40
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 333 bytes
コンパイル時間 88 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-11-19 16:56:47
合計ジャッジ時間 2,275 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 8 WA * 29
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
import sys
sys.setrecursionlimit(10**5)

n, a = map(int, input().split())

dict = defaultdict(int)
def dfs(val):
	if val == 1: return 1

	ret = 1
	if dict[val // a] != 0:
		return dict[val // a]
	else:
		dict[val // a] += 1
		ret += dfs(val // a)
		ret += dfs(val // a)
		return ret

print(dfs(n))
0