結果

問題 No.2318 Phys Bone Maker
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-02-26 03:29:29
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,306 ms / 3,000 ms
コード長 945 bytes
コンパイル時間 317 ms
コンパイル使用メモリ 81,808 KB
実行使用メモリ 76,168 KB
最終ジャッジ日時 2023-10-18 16:57:47
合計ジャッジ時間 13,353 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,728 KB
testcase_01 AC 37 ms
53,728 KB
testcase_02 AC 1,306 ms
76,060 KB
testcase_03 AC 49 ms
59,872 KB
testcase_04 AC 49 ms
57,472 KB
testcase_05 AC 49 ms
57,472 KB
testcase_06 AC 48 ms
57,472 KB
testcase_07 AC 50 ms
61,952 KB
testcase_08 AC 58 ms
62,032 KB
testcase_09 AC 47 ms
57,472 KB
testcase_10 AC 54 ms
57,472 KB
testcase_11 AC 51 ms
59,656 KB
testcase_12 AC 63 ms
62,012 KB
testcase_13 AC 76 ms
68,480 KB
testcase_14 AC 50 ms
57,472 KB
testcase_15 AC 49 ms
57,472 KB
testcase_16 AC 49 ms
57,472 KB
testcase_17 AC 56 ms
59,872 KB
testcase_18 AC 65 ms
64,080 KB
testcase_19 AC 44 ms
57,472 KB
testcase_20 AC 50 ms
57,472 KB
testcase_21 AC 48 ms
57,472 KB
testcase_22 AC 49 ms
60,068 KB
testcase_23 AC 47 ms
57,472 KB
testcase_24 AC 52 ms
57,472 KB
testcase_25 AC 50 ms
57,472 KB
testcase_26 AC 60 ms
64,072 KB
testcase_27 AC 52 ms
59,520 KB
testcase_28 AC 46 ms
57,472 KB
testcase_29 AC 46 ms
57,472 KB
testcase_30 AC 45 ms
57,472 KB
testcase_31 AC 54 ms
59,520 KB
testcase_32 AC 52 ms
57,472 KB
testcase_33 AC 38 ms
53,728 KB
testcase_34 AC 51 ms
59,520 KB
testcase_35 AC 211 ms
75,828 KB
testcase_36 AC 738 ms
75,960 KB
testcase_37 AC 666 ms
75,864 KB
testcase_38 AC 748 ms
75,940 KB
testcase_39 AC 1,057 ms
76,168 KB
testcase_40 AC 977 ms
75,896 KB
testcase_41 AC 1,218 ms
76,036 KB
testcase_42 AC 1,160 ms
75,932 KB
testcase_43 AC 68 ms
66,164 KB
testcase_44 AC 227 ms
75,892 KB
testcase_45 AC 216 ms
75,868 KB
testcase_46 AC 1,260 ms
76,168 KB
testcase_47 AC 54 ms
57,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = sys.stdin.readline
            
def main():
    n=int(input())
    l=list()
    for v in range(1,int(math.sqrt(n))+1):
        if n%v==0:
            l.append(v)
            if v < n//v: 
                l.append(n//v)

    l.sort()
    s=len(l)
    p=list()
    for v in l:
        if v!=1 and n%v == 0:            
            p.append(v)
            while n%v==0:
                n//=v

    dp=[0]*s
    dp[0]=1
    for i in range(s):
        for j in range(i+1,s):
            if l[j]%l[i]!=0:
                continue
            v=l[j]//l[i]
            add=dp[i]
            for pv in p:
                if v%pv==0:
                    continue
                cnt=1
                vi=l[i]
                while vi%pv==0:
                    vi//=pv
                    cnt+=1
                add*=cnt
            dp[j]=(dp[j]+add)%998244353
    print(dp[-1])
        
if __name__ == "__main__":
    main()
0