結果

問題 No.2318 Phys Bone Maker
ユーザー 👑 amentorimaruamentorimaru
提出日時 2023-02-21 20:54:17
言語 PyPy3
(7.3.15)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,498 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 81,788 KB
実行使用メモリ 134,484 KB
最終ジャッジ日時 2023-10-18 16:53:44
合計ジャッジ時間 14,605 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,652 KB
testcase_01 AC 40 ms
53,652 KB
testcase_02 TLE -
testcase_03 AC 47 ms
62,280 KB
testcase_04 AC 42 ms
59,512 KB
testcase_05 AC 41 ms
59,508 KB
testcase_06 AC 41 ms
59,508 KB
testcase_07 AC 68 ms
73,304 KB
testcase_08 AC 66 ms
70,768 KB
testcase_09 AC 42 ms
59,512 KB
testcase_10 AC 41 ms
59,512 KB
testcase_11 AC 47 ms
61,728 KB
testcase_12 AC 74 ms
73,708 KB
testcase_13 AC 189 ms
80,308 KB
testcase_14 AC 42 ms
59,508 KB
testcase_15 AC 42 ms
59,508 KB
testcase_16 AC 44 ms
59,508 KB
testcase_17 AC 46 ms
61,720 KB
testcase_18 AC 81 ms
76,356 KB
testcase_19 AC 41 ms
59,508 KB
testcase_20 AC 42 ms
59,508 KB
testcase_21 AC 41 ms
59,508 KB
testcase_22 AC 44 ms
61,520 KB
testcase_23 AC 43 ms
59,508 KB
testcase_24 AC 41 ms
59,512 KB
testcase_25 AC 44 ms
59,508 KB
testcase_26 AC 69 ms
73,388 KB
testcase_27 AC 43 ms
59,520 KB
testcase_28 AC 40 ms
59,508 KB
testcase_29 AC 41 ms
59,508 KB
testcase_30 AC 44 ms
59,508 KB
testcase_31 AC 47 ms
61,708 KB
testcase_32 AC 48 ms
59,508 KB
testcase_33 AC 39 ms
53,652 KB
testcase_34 AC 45 ms
61,044 KB
testcase_35 AC 1,571 ms
103,608 KB
testcase_36 AC 2,456 ms
106,840 KB
testcase_37 TLE -
testcase_38 TLE -
testcase_39 AC 2,952 ms
111,692 KB
testcase_40 TLE -
testcase_41 -- -
testcase_42 -- -
testcase_43 -- -
testcase_44 -- -
testcase_45 -- -
testcase_46 -- -
testcase_47 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
import math
input = sys.stdin.readline
sys.setrecursionlimit(10000000)
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())

    def getind(b):
        res=0
        for i in range(len(a)):
            res*=a[i]+1
            res+=b[i]
        return res
    dp = [0]*(getind(a)+1)
    dp[0]=1
    def solve2(i,b,bb):
        if i==len(a):
            ib = getind(b)
            ibb = getind(bb)
            if ib==ibb:return
            add=dp[ib]
            for i in range(len(b)):
                if b[i]==bb[i]:add*=b[i]+1
            dp[ibb]+=add
            dp[ibb]%=998244353
            return
        for j in range(b[i],a[i]+1):
            bb[i]=j
            solve2(i+1,b,bb)

    def solve(i,b):
        if i==len(a):
            solve2(0,b,list(b))
            return
        for j in range(a[i]+1):
            b[i]=j
            solve(i+1,b)
    solve(0,[0]*len(a))
    print(dp[-1])
        
if __name__ == "__main__":
    main()
0