結果

問題 No.847 Divisors of Power
ユーザー titiatitia
提出日時 2019-07-05 21:55:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 148 ms / 2,000 ms
コード長 534 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 81,920 KB
実行使用メモリ 82,740 KB
最終ジャッジ日時 2024-04-16 07:16:21
合計ジャッジ時間 2,745 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
52,096 KB
testcase_01 AC 40 ms
51,968 KB
testcase_02 AC 41 ms
52,480 KB
testcase_03 AC 41 ms
51,968 KB
testcase_04 AC 45 ms
52,480 KB
testcase_05 AC 41 ms
52,224 KB
testcase_06 AC 45 ms
58,368 KB
testcase_07 AC 46 ms
57,984 KB
testcase_08 AC 44 ms
57,984 KB
testcase_09 AC 44 ms
58,368 KB
testcase_10 AC 45 ms
58,496 KB
testcase_11 AC 47 ms
58,624 KB
testcase_12 AC 45 ms
57,984 KB
testcase_13 AC 50 ms
59,520 KB
testcase_14 AC 47 ms
57,984 KB
testcase_15 AC 142 ms
81,536 KB
testcase_16 AC 44 ms
57,600 KB
testcase_17 AC 45 ms
57,856 KB
testcase_18 AC 57 ms
62,336 KB
testcase_19 AC 77 ms
70,912 KB
testcase_20 AC 44 ms
57,344 KB
testcase_21 AC 106 ms
77,440 KB
testcase_22 AC 45 ms
58,240 KB
testcase_23 AC 43 ms
57,472 KB
testcase_24 AC 148 ms
82,740 KB
testcase_25 AC 45 ms
57,984 KB
testcase_26 AC 41 ms
52,096 KB
testcase_27 AC 44 ms
57,344 KB
testcase_28 AC 40 ms
52,224 KB
testcase_29 AC 40 ms
51,840 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