結果

問題 No.2318 Phys Bone Maker
ユーザー rlangevinrlangevin
提出日時 2023-05-27 19:21:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,852 ms / 3,000 ms
コード長 1,082 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 86,964 KB
実行使用メモリ 81,512 KB
最終ジャッジ日時 2023-08-26 23:28:10
合計ジャッジ時間 22,366 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 91 ms
71,936 KB
testcase_01 AC 91 ms
71,948 KB
testcase_02 AC 1,852 ms
81,496 KB
testcase_03 AC 123 ms
76,808 KB
testcase_04 AC 132 ms
76,900 KB
testcase_05 AC 117 ms
76,932 KB
testcase_06 AC 119 ms
76,956 KB
testcase_07 AC 115 ms
77,672 KB
testcase_08 AC 152 ms
77,752 KB
testcase_09 AC 123 ms
76,708 KB
testcase_10 AC 158 ms
77,016 KB
testcase_11 AC 174 ms
76,852 KB
testcase_12 AC 237 ms
77,984 KB
testcase_13 AC 220 ms
78,060 KB
testcase_14 AC 140 ms
77,188 KB
testcase_15 AC 138 ms
77,128 KB
testcase_16 AC 121 ms
76,908 KB
testcase_17 AC 150 ms
76,896 KB
testcase_18 AC 224 ms
77,704 KB
testcase_19 AC 113 ms
76,800 KB
testcase_20 AC 126 ms
77,216 KB
testcase_21 AC 119 ms
77,040 KB
testcase_22 AC 121 ms
77,252 KB
testcase_23 AC 120 ms
76,912 KB
testcase_24 AC 143 ms
77,296 KB
testcase_25 AC 144 ms
76,828 KB
testcase_26 AC 159 ms
77,820 KB
testcase_27 AC 131 ms
76,764 KB
testcase_28 AC 115 ms
76,824 KB
testcase_29 AC 111 ms
77,132 KB
testcase_30 AC 113 ms
76,828 KB
testcase_31 AC 169 ms
76,928 KB
testcase_32 AC 132 ms
77,132 KB
testcase_33 AC 91 ms
71,908 KB
testcase_34 AC 152 ms
76,904 KB
testcase_35 AC 389 ms
79,612 KB
testcase_36 AC 980 ms
80,440 KB
testcase_37 AC 928 ms
80,408 KB
testcase_38 AC 1,097 ms
80,392 KB
testcase_39 AC 1,459 ms
80,892 KB
testcase_40 AC 1,397 ms
81,132 KB
testcase_41 AC 1,628 ms
81,156 KB
testcase_42 AC 1,694 ms
81,512 KB
testcase_43 AC 221 ms
77,904 KB
testcase_44 AC 587 ms
79,404 KB
testcase_45 AC 560 ms
79,476 KB
testcase_46 AC 1,664 ms
81,312 KB
testcase_47 AC 130 ms
76,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import *

def div(n):
    if n <= 0:
        return []
    S = set()
    i = 1
    while i * i <= n:
        if n % i == 0:
            S.add(i)
            S.add(n // i)
        i += 1
    return sorted(list(S))

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])

    return dict(arr)


N = int(input())
mod = 998244353
L = div(N)
M = len(L)

ans = [0] * M
ans[0] = 1
dic = []
for i in range(M):
    dic.append(factorization(L[i]))

for i in range(M):
    for j in range(i + 1, M):
        val = ans[i]
        if L[j] % L[i] != 0:
            continue
        for k, v in dic[j].items():
            if k not in dic[i]:
                continue
            else:
                if dic[i][k] == v:
                    val *= v + 1
            val %= mod
        ans[j] += val
        ans[j] %= mod
        
print(ans[-1])
0