結果

問題 No.847 Divisors of Power
ユーザー chocoruskchocorusk
提出日時 2019-03-31 05:15:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 560 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 83,840 KB
最終ジャッジ日時 2024-04-16 07:02:27
合計ジャッジ時間 4,621 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
57,472 KB
testcase_01 AC 43 ms
52,224 KB
testcase_02 AC 43 ms
52,224 KB
testcase_03 AC 43 ms
52,224 KB
testcase_04 AC 52 ms
60,672 KB
testcase_05 AC 43 ms
52,224 KB
testcase_06 AC 46 ms
57,984 KB
testcase_07 AC 42 ms
52,352 KB
testcase_08 AC 46 ms
58,240 KB
testcase_09 AC 46 ms
58,496 KB
testcase_10 AC 49 ms
59,520 KB
testcase_11 AC 69 ms
67,456 KB
testcase_12 AC 46 ms
58,112 KB
testcase_13 AC 79 ms
69,504 KB
testcase_14 AC 65 ms
65,152 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import math
n, k, m=map(int, input().split())
fac=[]
for i in range(2, n+1):
    if i*i>n:
        break
    if n%i==0:
        e=0
        while n%i==0:
            n//=i
            e+=1
        fac.append((i, e))
if n>1:
    fac.append((n, 1))
def dfs(i, dans):
    if i==len(fac):
        if dans[0]<=m:
            dans[1]+=1
        return
    pp=1
    for j in range(min(k*fac[i][1], int(math.log(m, fac[i][0])))+1):
        dans[0]*=pp
        dfs(i+1, dans)
        dans[0]//=pp
        pp*=fac[i][0]
    return
dans=[1, 0]
dfs(0, dans)
print(dans[1])
0