結果

問題 No.1973 Divisor Sequence
ユーザー 👑 KazunKazun
提出日時 2022-06-10 21:31:08
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 933 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 112,440 KB
最終ジャッジ日時 2023-10-21 04:53:37
合計ジャッジ時間 4,050 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 35 ms
57,572 KB
testcase_01 AC 37 ms
53,224 KB
testcase_02 TLE -
testcase_03 -- -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#素因数分解
def Prime_Factorization(N):
    if N==0:
        return [[0,1]]

    if N<0:
        R=[[-1,1]]
    else:
        R=[]

    N=abs(N)

    if N&1==0:
        C=0
        while N&1==0:
            N>>=1
            C+=1
        R.append([2,C])

    if N%3==0:
        C=0
        while N%3==0:
            N//=3
            C+=1
        R.append([3,C])

    k=5
    Flag=0
    while k*k<=N:
        if N%k==0:
            C=0
            while N%k==0:
                C+=1
                N//=k
            R.append([k,C])
        k+=2+2*Flag
        Flag^=1

    if N!=1:
        R.append([N,1])

    return R
#==================================================
N,M=map(int,input().split())

F=Prime_Factorization(M)

X=1
Mod=10**9+7
for p,e in F:
    DP=[0]*(e+1); DP[0]=1

    for n in range(1,N+1):
        for i in range(1,e+1):
            DP[i]+=DP[i-1]
        DP.reverse()

    X*=sum(DP)
    X%=Mod

print(X)
0