結果

問題 No.2318 Phys Bone Maker
ユーザー miya145592miya145592
提出日時 2023-05-27 01:22:06
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,571 ms / 3,000 ms
コード長 1,144 bytes
コンパイル時間 556 ms
コンパイル使用メモリ 86,992 KB
実行使用メモリ 80,852 KB
最終ジャッジ日時 2023-08-26 15:00:13
合計ジャッジ時間 18,260 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,392 KB
testcase_01 AC 65 ms
71,684 KB
testcase_02 AC 1,493 ms
80,792 KB
testcase_03 AC 89 ms
75,788 KB
testcase_04 AC 97 ms
75,588 KB
testcase_05 AC 85 ms
75,732 KB
testcase_06 AC 86 ms
76,064 KB
testcase_07 AC 80 ms
76,420 KB
testcase_08 AC 115 ms
76,432 KB
testcase_09 AC 92 ms
75,868 KB
testcase_10 AC 119 ms
75,564 KB
testcase_11 AC 133 ms
75,756 KB
testcase_12 AC 189 ms
76,484 KB
testcase_13 AC 180 ms
76,968 KB
testcase_14 AC 104 ms
75,760 KB
testcase_15 AC 104 ms
75,568 KB
testcase_16 AC 89 ms
75,944 KB
testcase_17 AC 116 ms
75,748 KB
testcase_18 AC 171 ms
76,660 KB
testcase_19 AC 79 ms
75,904 KB
testcase_20 AC 94 ms
75,696 KB
testcase_21 AC 85 ms
75,556 KB
testcase_22 AC 88 ms
75,864 KB
testcase_23 AC 86 ms
75,980 KB
testcase_24 AC 105 ms
75,836 KB
testcase_25 AC 116 ms
75,952 KB
testcase_26 AC 118 ms
76,308 KB
testcase_27 AC 98 ms
75,492 KB
testcase_28 AC 81 ms
76,152 KB
testcase_29 AC 80 ms
75,720 KB
testcase_30 AC 83 ms
76,200 KB
testcase_31 AC 132 ms
75,868 KB
testcase_32 AC 97 ms
75,752 KB
testcase_33 AC 64 ms
71,532 KB
testcase_34 AC 116 ms
75,576 KB
testcase_35 AC 327 ms
78,900 KB
testcase_36 AC 800 ms
80,308 KB
testcase_37 AC 772 ms
80,460 KB
testcase_38 AC 905 ms
80,572 KB
testcase_39 AC 1,338 ms
80,576 KB
testcase_40 AC 1,106 ms
80,396 KB
testcase_41 AC 1,302 ms
80,588 KB
testcase_42 AC 1,390 ms
80,740 KB
testcase_43 AC 176 ms
76,708 KB
testcase_44 AC 517 ms
78,908 KB
testcase_45 AC 469 ms
78,752 KB
testcase_46 AC 1,571 ms
80,852 KB
testcase_47 AC 92 ms
75,904 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def factorization(n):
    arr = dict()
    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[i]=cnt

    if temp!=1:
        arr[temp]=1

    if len(arr)==0:
        arr[n]=1

    return arr

MOD = 998244353
N = int(input())
Y = make_divisors(N)
F = []
for y in Y:
    F.append(factorization(y))
dp = [0 for _ in range(len(Y))]
dp[0] = 1
for i in range(len((Y))):
    for j in range(i+1, len(Y)):
        #Y[i] -> Y[j]
        if Y[j]%Y[i]!=0:
            continue
        temp = dp[i]
        for p in F[i]:
            if p==1:
                continue
            ej = F[j][p]
            ei = F[i][p]
            if ei==ej:
                temp=temp*(ej+1)%MOD
        dp[j] = (dp[j]+temp)%MOD
print(dp[-1])
0