結果

問題 No.847 Divisors of Power
ユーザー simamumusimamumu
提出日時 2019-07-05 22:49:38
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 909 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 138,752 KB
最終ジャッジ日時 2024-04-16 07:56:03
合計ジャッジ時間 5,075 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
75,136 KB
testcase_01 AC 75 ms
69,848 KB
testcase_02 AC 75 ms
70,812 KB
testcase_03 AC 73 ms
69,632 KB
testcase_04 AC 81 ms
71,552 KB
testcase_05 AC 79 ms
70,912 KB
testcase_06 AC 75 ms
70,068 KB
testcase_07 AC 74 ms
70,016 KB
testcase_08 AC 75 ms
70,272 KB
testcase_09 AC 74 ms
70,016 KB
testcase_10 AC 79 ms
71,296 KB
testcase_11 AC 77 ms
71,172 KB
testcase_12 AC 75 ms
70,144 KB
testcase_13 AC 76 ms
71,064 KB
testcase_14 AC 77 ms
71,168 KB
testcase_15 TLE -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict,deque
import sys,heapq,bisect,math,itertools,string,queue,copy,time
sys.setrecursionlimit(10**8)
INF = float('inf')
mod = 10**9+7
eps = 10**-7
def inp(): return int(input())
def inpl(): return list(map(int, input().split()))
def inpl_str(): return list(input().split())

def facdiv(n):
    factor = defaultdict(int)
    ed = set()
    tmp = int(math.sqrt(n)) + 1
    for num in range(2,tmp):
        while n % num == 0:
            n //= num
            ed.add(num)
            factor[num] += 1

    ed.add(n)
    factor[n] += 1
    return factor,ed

N,K,M = inpl()
fac,ed = facdiv(N)

ans = set([1])
for e in ed:
    newans = set()
    for k in range(K*fac[e]+1):
        p = pow(e,k)
        if p > M:
            break
        for a in ans:
            if a*p > M:
                break
            newans.add(a*p)
    ans = list(newans)
    ans.sort()

print(len(ans))
0