結果

問題 No.847 Divisors of Power
ユーザー 👑 timitimi
提出日時 2021-01-05 11:56:42
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 133 ms / 2,000 ms
コード長 751 bytes
コンパイル時間 400 ms
コンパイル使用メモリ 87,292 KB
実行使用メモリ 77,796 KB
最終ジャッジ日時 2023-08-05 21:45:15
合計ジャッジ時間 5,262 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 101 ms
71,956 KB
testcase_01 AC 99 ms
71,716 KB
testcase_02 AC 99 ms
71,744 KB
testcase_03 AC 104 ms
72,084 KB
testcase_04 AC 100 ms
72,044 KB
testcase_05 AC 102 ms
71,876 KB
testcase_06 AC 110 ms
76,900 KB
testcase_07 AC 107 ms
76,588 KB
testcase_08 AC 107 ms
76,664 KB
testcase_09 AC 107 ms
76,628 KB
testcase_10 AC 107 ms
76,720 KB
testcase_11 AC 110 ms
76,516 KB
testcase_12 AC 111 ms
76,768 KB
testcase_13 AC 114 ms
77,352 KB
testcase_14 AC 110 ms
77,032 KB
testcase_15 AC 133 ms
77,668 KB
testcase_16 AC 105 ms
76,756 KB
testcase_17 AC 109 ms
76,744 KB
testcase_18 AC 113 ms
77,604 KB
testcase_19 AC 115 ms
77,492 KB
testcase_20 AC 103 ms
76,740 KB
testcase_21 AC 123 ms
77,488 KB
testcase_22 AC 105 ms
76,620 KB
testcase_23 AC 106 ms
76,736 KB
testcase_24 AC 130 ms
77,796 KB
testcase_25 AC 103 ms
76,652 KB
testcase_26 AC 98 ms
72,092 KB
testcase_27 AC 103 ms
76,736 KB
testcase_28 AC 99 ms
72,076 KB
testcase_29 AC 75 ms
71,188 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