結果

問題 No.847 Divisors of Power
コンテスト
ユーザー tails1434
提出日時 2020-01-05 20:06:18
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
AC  
実行時間 82 ms / 2,000 ms
+ 749µs
コード長 755 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 63 ms
コンパイル使用メモリ 81,960 KB
実行使用メモリ 84,456 KB
最終ジャッジ日時 2026-09-28 09:25:21
合計ジャッジ時間 3,063 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge4_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 26
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
sys.setrecursionlimit(10 ** 7)

def fctr1(n): 
    f=[]
    c=0
    r=int(n**0.5)
    for i in range(2,r+2):
        while n%i==0:
            c+=1
            n=n//i
        if c!=0:
            f.append([i,c])
            c=0
    if n!=1:
        f.append([n,1])
    return f

def main():
    N, K, M = map(int, input().split())
    d = fctr1(N)
    for i in range(len(d)):
        d[i][1] = d[i][1] * K

    def dfs(x, y):
        if x == len(d):
            return 1

        cnt = 0
        tmp = 1
        for i in range(d[x][1] + 1):
            tmp = y * (d[x][0] ** i)
            if tmp > M:
                break
            cnt += dfs(x + 1, tmp)

        return cnt

    print(dfs(0,1))
    


if __name__ == "__main__":
    main()
0