結果

問題 No.847 Divisors of Power
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-11 17:08:14
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 743 bytes
コンパイル時間 305 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 77,104 KB
最終ジャッジ日時 2023-09-09 19:01:11
合計ジャッジ時間 6,141 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,692 KB
testcase_01 AC 69 ms
71,708 KB
testcase_02 AC 69 ms
71,788 KB
testcase_03 AC 215 ms
77,104 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
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())
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])
    if arr==[]:
        arr.append([n, 1])
    return arr
l=factorization(n)
p=[]
for key,val in l:
    if key<=m:
        p.append([key,val*k])
kouho=[]
for key,val in p:
    tmp=[]
    for i in range(val+1):
        tmp.append(pow(key,i))
    kouho.append(tmp)
from itertools import product
ans=set()
for i in product(*kouho):
    now=1
    for j in i:
        now*=j
    if now<=m:
        ans.add(now)
print(len(ans))
0