結果

問題 No.2318 Phys Bone Maker
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-02-21 22:05:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 2,364 ms / 3,000 ms
コード長 1,373 bytes
コンパイル時間 192 ms
コンパイル使用メモリ 81,772 KB
実行使用メモリ 81,560 KB
最終ジャッジ日時 2023-10-18 16:54:24
合計ジャッジ時間 20,036 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,560 KB
testcase_01 AC 37 ms
53,560 KB
testcase_02 AC 2,364 ms
81,560 KB
testcase_03 AC 45 ms
62,452 KB
testcase_04 AC 41 ms
59,544 KB
testcase_05 AC 40 ms
59,412 KB
testcase_06 AC 41 ms
59,412 KB
testcase_07 AC 55 ms
66,436 KB
testcase_08 AC 54 ms
66,448 KB
testcase_09 AC 41 ms
59,544 KB
testcase_10 AC 40 ms
59,544 KB
testcase_11 AC 46 ms
61,808 KB
testcase_12 AC 54 ms
64,404 KB
testcase_13 AC 62 ms
72,636 KB
testcase_14 AC 42 ms
59,540 KB
testcase_15 AC 42 ms
59,544 KB
testcase_16 AC 44 ms
59,412 KB
testcase_17 AC 44 ms
59,952 KB
testcase_18 AC 56 ms
66,452 KB
testcase_19 AC 40 ms
59,412 KB
testcase_20 AC 41 ms
59,412 KB
testcase_21 AC 41 ms
59,412 KB
testcase_22 AC 43 ms
59,884 KB
testcase_23 AC 42 ms
59,412 KB
testcase_24 AC 40 ms
59,544 KB
testcase_25 AC 44 ms
59,412 KB
testcase_26 AC 55 ms
66,452 KB
testcase_27 AC 43 ms
59,544 KB
testcase_28 AC 41 ms
59,412 KB
testcase_29 AC 41 ms
59,412 KB
testcase_30 AC 44 ms
59,412 KB
testcase_31 AC 44 ms
59,552 KB
testcase_32 AC 46 ms
59,412 KB
testcase_33 AC 36 ms
53,560 KB
testcase_34 AC 44 ms
60,908 KB
testcase_35 AC 328 ms
76,464 KB
testcase_36 AC 1,142 ms
78,472 KB
testcase_37 AC 1,173 ms
78,520 KB
testcase_38 AC 1,223 ms
78,692 KB
testcase_39 AC 1,660 ms
79,756 KB
testcase_40 AC 1,719 ms
79,920 KB
testcase_41 AC 1,955 ms
80,464 KB
testcase_42 AC 1,997 ms
80,720 KB
testcase_43 AC 70 ms
75,648 KB
testcase_44 AC 421 ms
76,508 KB
testcase_45 AC 396 ms
76,456 KB
testcase_46 AC 2,146 ms
81,044 KB
testcase_47 AC 54 ms
59,412 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
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())
    c=dict()
    while(n > 1):
        find = False
        v = 2
        while v*v<=n:
            if n%v==0:
                find=True
                c[v]=c.get(v,0)+1
                n//=v
                break
            v+=1
        if find==False:
            c[n]=c.get(n,0)+1
            break
    a=list(c.values())
    sa=len(a)

    dp = {}        
    ar=[0]*(sa+1)
    dp[tuple(ar)]=1
    while ar[-1]==0:
        ar2=list(ar)
        while ar2[-1]==0:
            if ar != ar2:
                add = dp[tuple(ar)]
                for i in range(sa):
                    if ar[i]==ar2[i]:
                        add*=ar[i]+1
                dp[tuple(ar2)]=(dp.get(tuple(ar2),0)+add)%998244353
            ar2[0]+=1
            for i in range(sa):
                if ar2[i]>a[i]:
                    ar2[i]=ar[i]
                    ar2[i+1]+=1
        ar[0]+=1
        for i in range(sa):
            if ar[i]>a[i]:
                ar[i]=0
                ar[i+1]+=1
    a.append(0)
    print(dp[tuple(a)])
        
if __name__ == "__main__":
    main()
0