結果

問題 No.847 Divisors of Power
ユーザー aaaaaaaaaa2230aaaaaaaaaa2230
提出日時 2022-05-20 12:34:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 502 bytes
コンパイル時間 1,218 ms
コンパイル使用メモリ 81,544 KB
実行使用メモリ 115,824 KB
最終ジャッジ日時 2023-10-20 00:27:03
合計ジャッジ時間 5,604 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,804 KB
testcase_01 AC 37 ms
53,700 KB
testcase_02 AC 40 ms
60,136 KB
testcase_03 AC 33 ms
53,704 KB
testcase_04 AC 41 ms
60,168 KB
testcase_05 AC 42 ms
60,316 KB
testcase_06 AC 39 ms
59,760 KB
testcase_07 AC 37 ms
57,708 KB
testcase_08 AC 37 ms
57,708 KB
testcase_09 AC 37 ms
57,708 KB
testcase_10 AC 43 ms
60,000 KB
testcase_11 AC 42 ms
60,248 KB
testcase_12 AC 37 ms
57,708 KB
testcase_13 AC 38 ms
59,756 KB
testcase_14 AC 39 ms
60,000 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 #

n,k,m = map(int,input().split())
divs = {}
for i in range(2,int(n**0.5)+1):
    if n%i:
        continue
    c = 0
    while n%i == 0:
        n //= i
        c += 1
    divs[i] = c*k

if n:
    divs[n] = k


dp = set()
dp.add(1)

for key,value in divs.items():
    ndp = set()
    for d in dp:
        ndp.add(d)
        nd = d
        for p in range(value):
            nd *= key
            if nd <= m:
                ndp.add(nd)
            else:
                break
    dp = ndp

print(len(dp))
0