結果

問題 No.2318 Phys Bone Maker
ユーザー miya145592miya145592
提出日時 2023-05-27 01:07:36
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,288 bytes
コンパイル時間 429 ms
コンパイル使用メモリ 87,204 KB
実行使用メモリ 81,612 KB
最終ジャッジ日時 2023-08-26 14:52:39
合計ジャッジ時間 31,015 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 64 ms
71,516 KB
testcase_01 AC 65 ms
71,636 KB
testcase_02 TLE -
testcase_03 AC 90 ms
75,920 KB
testcase_04 AC 100 ms
75,644 KB
testcase_05 AC 88 ms
75,872 KB
testcase_06 AC 86 ms
76,040 KB
testcase_07 AC 89 ms
76,656 KB
testcase_08 AC 126 ms
76,436 KB
testcase_09 AC 93 ms
75,776 KB
testcase_10 AC 122 ms
75,556 KB
testcase_11 AC 138 ms
75,748 KB
testcase_12 AC 196 ms
76,452 KB
testcase_13 AC 199 ms
77,464 KB
testcase_14 AC 111 ms
76,008 KB
testcase_15 AC 108 ms
75,688 KB
testcase_16 AC 90 ms
75,748 KB
testcase_17 AC 113 ms
75,648 KB
testcase_18 AC 181 ms
76,588 KB
testcase_19 AC 83 ms
75,948 KB
testcase_20 AC 97 ms
75,624 KB
testcase_21 AC 89 ms
75,544 KB
testcase_22 AC 93 ms
75,624 KB
testcase_23 AC 89 ms
75,824 KB
testcase_24 AC 112 ms
76,104 KB
testcase_25 AC 110 ms
75,872 KB
testcase_26 AC 130 ms
76,676 KB
testcase_27 AC 100 ms
76,108 KB
testcase_28 AC 86 ms
75,528 KB
testcase_29 AC 83 ms
75,916 KB
testcase_30 AC 84 ms
75,516 KB
testcase_31 AC 136 ms
75,528 KB
testcase_32 AC 94 ms
75,624 KB
testcase_33 AC 64 ms
71,516 KB
testcase_34 AC 115 ms
75,644 KB
testcase_35 AC 448 ms
78,668 KB
testcase_36 AC 1,690 ms
80,500 KB
testcase_37 AC 1,687 ms
80,468 KB
testcase_38 AC 1,699 ms
80,164 KB
testcase_39 AC 2,470 ms
80,452 KB
testcase_40 AC 2,763 ms
80,808 KB
testcase_41 AC 2,786 ms
80,740 KB
testcase_42 TLE -
testcase_43 AC 183 ms
77,044 KB
testcase_44 AC 655 ms
79,236 KB
testcase_45 AC 598 ms
78,992 KB
testcase_46 AC 2,951 ms
80,912 KB
testcase_47 AC 97 ms
76,008 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]
        temp = dp[i]
        for p in F[i]:
            if p==1:
                continue
            if p not in F[j]:
                temp=0
                break
            else:
                ej = F[j][p]
                ei = F[i][p]
                if ei>ej:
                    temp=0
                    break
                elif ei==ej:
                    temp=temp*(ej+1)%MOD
        dp[j] = (dp[j]+temp)%MOD
print(dp[-1])
0