結果

問題 No.847 Divisors of Power
ユーザー convexineq
提出日時 2021-02-18 21:44:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 426 bytes
コンパイル時間 186 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 75,572 KB
最終ジャッジ日時 2024-09-15 02:44:44
合計ジャッジ時間 5,286 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample -- * 4
other AC * 21 WA * 2 TLE * 1 -- * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,m = map(int,input().split())

fac = []
for i in range(2,n+1):
    if n < i*i:
        fac.append((n,k))
        break
    c = 0
    while n%i == 0:
        n //= i
        c += 1
    if c: fac.append((i,c*k))

L = len(fac)
ans = 0
def dfs(x,i):
    global ans
    if i >= L:
        ans += 1
        return
    p,c = fac[i]
    while x <= m and c >= 0:
        dfs(x,i+1)
        x *= p
        c -= 1

dfs(1,0)
print(ans)
0