結果

問題 No.847 Divisors of Power
ユーザー DrDrpilotDrDrpilot
提出日時 2022-02-11 17:10:24
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 773 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 86,776 KB
実行使用メモリ 76,672 KB
最終ジャッジ日時 2023-09-09 19:04:13
合計ジャッジ時間 5,420 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,724 KB
testcase_01 AC 69 ms
71,776 KB
testcase_02 AC 70 ms
71,656 KB
testcase_03 AC 73 ms
71,432 KB
testcase_04 AC 84 ms
76,668 KB
testcase_05 AC 73 ms
71,596 KB
testcase_06 AC 73 ms
75,868 KB
testcase_07 AC 73 ms
75,712 KB
testcase_08 AC 74 ms
75,768 KB
testcase_09 AC 73 ms
75,772 KB
testcase_10 AC 77 ms
76,496 KB
testcase_11 AC 81 ms
76,672 KB
testcase_12 AC 76 ms
75,760 KB
testcase_13 AC 80 ms
76,656 KB
testcase_14 AC 79 ms
76,652 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())
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):
        if pow(key,i)<=m:
            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