結果

問題 No.847 Divisors of Power
ユーザー convexineq
提出日時 2021-02-18 21:34:35
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 423 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,540 KB
実行使用メモリ 75,704 KB
最終ジャッジ日時 2024-09-15 02:36:13
合計ジャッジ時間 5,072 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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):
    c = 0
    while n%i == 0:
        n //= i
        c += 1
    if c: fac.append((i,c*k))
    if n < i*i:
        fac.append((n,k))
        break

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