結果

問題 No.847 Divisors of Power
ユーザー 👑 timitimi
提出日時 2021-01-05 11:56:42
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 96 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 172 ms
コンパイル使用メモリ 82,048 KB
実行使用メモリ 78,976 KB
最終ジャッジ日時 2024-04-23 18:08:34
合計ジャッジ時間 2,811 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 46 ms
53,888 KB
testcase_01 AC 47 ms
53,760 KB
testcase_02 AC 48 ms
54,016 KB
testcase_03 AC 47 ms
53,632 KB
testcase_04 AC 47 ms
54,400 KB
testcase_05 AC 47 ms
54,144 KB
testcase_06 AC 49 ms
58,880 KB
testcase_07 AC 53 ms
59,264 KB
testcase_08 AC 51 ms
58,880 KB
testcase_09 AC 51 ms
59,648 KB
testcase_10 AC 51 ms
59,648 KB
testcase_11 AC 53 ms
59,904 KB
testcase_12 AC 50 ms
59,264 KB
testcase_13 AC 57 ms
62,208 KB
testcase_14 AC 53 ms
60,032 KB
testcase_15 AC 95 ms
78,976 KB
testcase_16 AC 50 ms
59,264 KB
testcase_17 AC 51 ms
59,008 KB
testcase_18 AC 59 ms
61,952 KB
testcase_19 AC 60 ms
63,104 KB
testcase_20 AC 51 ms
59,392 KB
testcase_21 AC 78 ms
69,760 KB
testcase_22 AC 50 ms
59,136 KB
testcase_23 AC 51 ms
59,136 KB
testcase_24 AC 96 ms
78,848 KB
testcase_25 AC 51 ms
59,264 KB
testcase_26 AC 46 ms
53,888 KB
testcase_27 AC 50 ms
59,264 KB
testcase_28 AC 46 ms
53,760 KB
testcase_29 AC 42 ms
51,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,K,M=map(int, input().split())
if N==1:
  print(1)
  exit()
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
A=factorization(N)
a=len(A)
#print(A)
D=[]
for a,b in A:
  D.append((a,b*K))
#print(D)
from collections import deque
d=deque()
d.append(1)
nd=deque()
ans=0
for i in range(len(D)):
  while len(d):
    p=d.popleft()
    s,t=D[i]
    n=0
    while p*pow(s,n)<=M and n<=t:
      nd.append(p*pow(s,n))
      n+=1
  d=nd
  nd=deque()
print(len(d))
0