結果

問題 No.847 Divisors of Power
ユーザー 👑 timitimi
提出日時 2021-01-05 11:52:16
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 65,920 KB
最終ジャッジ日時 2024-04-23 18:05:31
合計ジャッジ時間 2,411 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,888 KB
testcase_01 AC 43 ms
54,016 KB
testcase_02 WA -
testcase_03 AC 41 ms
54,016 KB
testcase_04 WA -
testcase_05 AC 39 ms
54,272 KB
testcase_06 AC 42 ms
59,264 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 40 ms
58,880 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 RE -
testcase_21 WA -
testcase_22 AC 41 ms
59,008 KB
testcase_23 RE -
testcase_24 WA -
testcase_25 AC 40 ms
59,776 KB
testcase_26 AC 39 ms
54,144 KB
testcase_27 RE -
testcase_28 AC 38 ms
54,016 KB
testcase_29 AC 38 ms
51,840 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)
D=[]
for a,b in A:
  D.append((a,b*K))
from collections import deque
d=deque()
d.append(1)
nd=deque()
ans=0
for i in range(2):
  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