結果

問題 No.2318 Phys Bone Maker
ユーザー miya145592miya145592
提出日時 2023-05-27 01:03:34
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 1,371 bytes
コンパイル時間 301 ms
コンパイル使用メモリ 87,140 KB
実行使用メモリ 81,208 KB
最終ジャッジ日時 2023-08-26 14:48:22
合計ジャッジ時間 32,471 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 66 ms
71,736 KB
testcase_01 AC 66 ms
71,972 KB
testcase_02 TLE -
testcase_03 AC 98 ms
75,988 KB
testcase_04 AC 105 ms
76,048 KB
testcase_05 AC 91 ms
76,036 KB
testcase_06 AC 90 ms
76,076 KB
testcase_07 AC 87 ms
76,896 KB
testcase_08 AC 127 ms
76,832 KB
testcase_09 AC 94 ms
75,972 KB
testcase_10 AC 127 ms
75,904 KB
testcase_11 AC 144 ms
75,956 KB
testcase_12 AC 200 ms
76,876 KB
testcase_13 AC 199 ms
77,612 KB
testcase_14 AC 109 ms
75,984 KB
testcase_15 AC 106 ms
75,796 KB
testcase_16 AC 90 ms
76,040 KB
testcase_17 AC 119 ms
75,788 KB
testcase_18 AC 187 ms
76,864 KB
testcase_19 AC 84 ms
76,112 KB
testcase_20 AC 97 ms
76,040 KB
testcase_21 AC 90 ms
75,896 KB
testcase_22 AC 92 ms
76,036 KB
testcase_23 AC 91 ms
76,040 KB
testcase_24 AC 114 ms
76,044 KB
testcase_25 AC 119 ms
75,976 KB
testcase_26 AC 131 ms
76,900 KB
testcase_27 AC 103 ms
75,904 KB
testcase_28 AC 87 ms
76,108 KB
testcase_29 AC 84 ms
75,908 KB
testcase_30 AC 85 ms
75,656 KB
testcase_31 AC 139 ms
75,792 KB
testcase_32 AC 101 ms
76,024 KB
testcase_33 AC 66 ms
71,392 KB
testcase_34 AC 119 ms
76,348 KB
testcase_35 AC 463 ms
79,152 KB
testcase_36 AC 1,863 ms
81,136 KB
testcase_37 AC 1,821 ms
80,612 KB
testcase_38 AC 1,903 ms
80,528 KB
testcase_39 AC 2,744 ms
80,964 KB
testcase_40 AC 2,749 ms
80,796 KB
testcase_41 TLE -
testcase_42 TLE -
testcase_43 AC 195 ms
77,016 KB
testcase_44 AC 704 ms
79,344 KB
testcase_45 AC 642 ms
79,256 KB
testcase_46 TLE -
testcase_47 AC 103 ms
75,856 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 = []
    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.append([i, cnt])

    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])

    return arr

MOD = 998244353
N = int(input())
Y = make_divisors(N)
F = []
for y in Y:
    f = factorization(y)
    d = dict()
    for p, e in f:
        d[p] = e
    F.append(d)
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