結果

問題 No.847 Divisors of Power
ユーザー titiatitia
提出日時 2019-07-05 21:55:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 207 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 135 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 16,128 KB
最終ジャッジ日時 2024-04-16 07:16:40
合計ジャッジ時間 2,387 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 32 ms
10,880 KB
testcase_01 AC 33 ms
10,880 KB
testcase_02 AC 30 ms
11,008 KB
testcase_03 AC 31 ms
10,880 KB
testcase_04 AC 31 ms
10,880 KB
testcase_05 AC 30 ms
10,880 KB
testcase_06 AC 34 ms
10,880 KB
testcase_07 AC 39 ms
10,880 KB
testcase_08 AC 35 ms
10,880 KB
testcase_09 AC 34 ms
10,880 KB
testcase_10 AC 32 ms
11,008 KB
testcase_11 AC 35 ms
10,880 KB
testcase_12 AC 33 ms
10,880 KB
testcase_13 AC 32 ms
10,880 KB
testcase_14 AC 33 ms
10,880 KB
testcase_15 AC 190 ms
15,104 KB
testcase_16 AC 36 ms
10,880 KB
testcase_17 AC 34 ms
11,008 KB
testcase_18 AC 35 ms
10,880 KB
testcase_19 AC 37 ms
11,008 KB
testcase_20 AC 33 ms
10,880 KB
testcase_21 AC 80 ms
12,544 KB
testcase_22 AC 34 ms
10,880 KB
testcase_23 AC 36 ms
10,880 KB
testcase_24 AC 207 ms
16,128 KB
testcase_25 AC 35 ms
10,880 KB
testcase_26 AC 30 ms
10,880 KB
testcase_27 AC 36 ms
10,880 KB
testcase_28 AC 30 ms
10,880 KB
testcase_29 AC 30 ms
10,880 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

x,K,M=map(int,input().split())


import math 
L=int(math.sqrt(x))

FACT=dict()

for i in range(2,L+2):
    while x%i==0:
        FACT[i]=FACT.get(i,0)+1
        x=x//i

if x!=1:
    FACT[x]=FACT.get(x,0)+1

for x in FACT:
    FACT[x]*=K

L=list(FACT.keys())
LEN=len(L)
ANS=[]

def divi(i,NOW):
    #print(i,NOW)
    if i==LEN:
        ANS.append(NOW)
        return
        
    for j in range(FACT[L[i]]+1):
        if (L[i]**j)*NOW<=M:
            divi(i+1,(L[i]**j)*NOW)
        else:
            break

divi(0,1)

print(len(ANS))
0