結果

問題 No.2318 Phys Bone Maker
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-02-21 22:48:23
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,437 ms / 3,000 ms
コード長 1,218 bytes
コンパイル時間 275 ms
コンパイル使用メモリ 81,824 KB
実行使用メモリ 76,292 KB
最終ジャッジ日時 2023-10-18 16:55:29
合計ジャッジ時間 14,149 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,736 KB
testcase_01 AC 37 ms
53,736 KB
testcase_02 AC 1,437 ms
76,064 KB
testcase_03 AC 50 ms
59,880 KB
testcase_04 AC 49 ms
59,524 KB
testcase_05 AC 48 ms
59,524 KB
testcase_06 AC 47 ms
59,524 KB
testcase_07 AC 52 ms
64,156 KB
testcase_08 AC 59 ms
64,236 KB
testcase_09 AC 47 ms
59,524 KB
testcase_10 AC 55 ms
59,524 KB
testcase_11 AC 53 ms
59,672 KB
testcase_12 AC 64 ms
64,088 KB
testcase_13 AC 79 ms
70,620 KB
testcase_14 AC 50 ms
59,524 KB
testcase_15 AC 49 ms
59,524 KB
testcase_16 AC 49 ms
59,524 KB
testcase_17 AC 56 ms
59,880 KB
testcase_18 AC 68 ms
64,232 KB
testcase_19 AC 45 ms
59,524 KB
testcase_20 AC 51 ms
59,524 KB
testcase_21 AC 48 ms
59,524 KB
testcase_22 AC 50 ms
60,076 KB
testcase_23 AC 49 ms
59,524 KB
testcase_24 AC 52 ms
59,524 KB
testcase_25 AC 51 ms
59,524 KB
testcase_26 AC 63 ms
64,220 KB
testcase_27 AC 53 ms
59,524 KB
testcase_28 AC 47 ms
59,524 KB
testcase_29 AC 47 ms
59,524 KB
testcase_30 AC 46 ms
59,524 KB
testcase_31 AC 55 ms
59,524 KB
testcase_32 AC 52 ms
59,524 KB
testcase_33 AC 38 ms
53,736 KB
testcase_34 AC 53 ms
59,676 KB
testcase_35 AC 222 ms
75,956 KB
testcase_36 AC 797 ms
76,080 KB
testcase_37 AC 733 ms
75,992 KB
testcase_38 AC 793 ms
76,056 KB
testcase_39 AC 1,165 ms
76,288 KB
testcase_40 AC 1,090 ms
76,088 KB
testcase_41 AC 1,300 ms
76,280 KB
testcase_42 AC 1,216 ms
76,072 KB
testcase_43 AC 72 ms
66,308 KB
testcase_44 AC 243 ms
75,996 KB
testcase_45 AC 231 ms
75,996 KB
testcase_46 AC 1,365 ms
76,292 KB
testcase_47 AC 55 ms
59,524 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = sys.stdin.readline
def read_values(): return map(int, input().split())
def read_index(): return map(lambda x: int(x) - 1, input().split())
def read_list(): return list(read_values())
def read_lists(N): return [read_list() for _ in range(N)]
            
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)
    p=list()
    for v in l:
        if v==1:continue
        isprime = True
        for v2 in l:
            if v2==1:continue
            if v==v2:continue
            isprime=isprime and v%v2>0
        if isprime==True:p.append(v)

    l.sort()
    s=len(l)
    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