結果

問題 No.847 Divisors of Power
ユーザー stngstng
提出日時 2022-07-17 16:51:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 165 ms / 2,000 ms
コード長 972 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 87,480 KB
実行使用メモリ 80,576 KB
最終ジャッジ日時 2023-09-12 04:54:59
合計ジャッジ時間 5,384 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,788 KB
testcase_01 AC 78 ms
71,628 KB
testcase_02 AC 77 ms
71,832 KB
testcase_03 AC 76 ms
71,592 KB
testcase_04 AC 75 ms
71,996 KB
testcase_05 AC 76 ms
71,752 KB
testcase_06 AC 79 ms
75,776 KB
testcase_07 AC 86 ms
75,876 KB
testcase_08 AC 78 ms
75,848 KB
testcase_09 AC 78 ms
75,772 KB
testcase_10 AC 78 ms
75,940 KB
testcase_11 AC 80 ms
76,216 KB
testcase_12 AC 77 ms
76,212 KB
testcase_13 AC 81 ms
76,028 KB
testcase_14 AC 80 ms
75,956 KB
testcase_15 AC 160 ms
78,484 KB
testcase_16 AC 75 ms
75,956 KB
testcase_17 AC 77 ms
75,840 KB
testcase_18 AC 85 ms
76,764 KB
testcase_19 AC 112 ms
78,496 KB
testcase_20 AC 78 ms
75,868 KB
testcase_21 AC 156 ms
80,576 KB
testcase_22 AC 78 ms
75,704 KB
testcase_23 AC 79 ms
75,832 KB
testcase_24 AC 165 ms
80,208 KB
testcase_25 AC 78 ms
75,820 KB
testcase_26 AC 76 ms
71,856 KB
testcase_27 AC 77 ms
75,604 KB
testcase_28 AC 76 ms
71,460 KB
testcase_29 AC 74 ms
71,556 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,k,m = map(int,input().split())
import math
import sys
sys.setrecursionlimit(10**7)

def base10to(n, b):
    if (int(n/b)):
        return base10to(int(n/b), b) + str(n%b)
    return str(n%b)


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

fac = factorization(n)
#fac = fac[1:]
#print(fac)
ans = 0

def dfs(v,ttl):
    global ans
    if v == len(fac):
        ans += 1
        return
    for i in range(31):
        if fac[v][1]*k < i:
            break
        if fac[v][0] == 1 and i >= 1:
            break
        num = pow(fac[v][0],i)
        if ttl*num <= m:
            dfs(v+1,ttl*num)
        else:
            break
#if len(fac) > 0:
dfs(0,1)
print(ans)
0