結果

問題 No.1923 Divisor Array
ユーザー 👑 tatyamtatyam
提出日時 2022-05-02 18:01:58
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 299 ms / 2,000 ms
コード長 899 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 86,888 KB
実行使用メモリ 78,988 KB
最終ジャッジ日時 2023-09-14 14:40:37
合計ジャッジ時間 9,814 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,076 KB
testcase_01 AC 69 ms
71,108 KB
testcase_02 AC 299 ms
78,988 KB
testcase_03 AC 69 ms
71,144 KB
testcase_04 AC 218 ms
78,268 KB
testcase_05 AC 163 ms
77,664 KB
testcase_06 AC 247 ms
78,548 KB
testcase_07 AC 170 ms
78,160 KB
testcase_08 AC 169 ms
77,928 KB
testcase_09 AC 263 ms
78,772 KB
testcase_10 AC 151 ms
77,796 KB
testcase_11 AC 157 ms
77,748 KB
testcase_12 AC 182 ms
78,064 KB
testcase_13 AC 141 ms
77,696 KB
testcase_14 AC 68 ms
71,528 KB
testcase_15 AC 69 ms
71,044 KB
testcase_16 AC 70 ms
71,152 KB
testcase_17 AC 69 ms
71,408 KB
testcase_18 AC 68 ms
71,208 KB
testcase_19 AC 69 ms
71,232 KB
testcase_20 AC 70 ms
71,252 KB
testcase_21 AC 70 ms
71,140 KB
testcase_22 AC 70 ms
71,404 KB
testcase_23 AC 70 ms
71,112 KB
testcase_24 AC 192 ms
78,132 KB
testcase_25 AC 222 ms
78,464 KB
testcase_26 AC 244 ms
78,612 KB
testcase_27 AC 233 ms
78,464 KB
testcase_28 AC 176 ms
77,840 KB
testcase_29 AC 156 ms
77,988 KB
testcase_30 AC 199 ms
78,048 KB
testcase_31 AC 245 ms
78,568 KB
testcase_32 AC 254 ms
78,716 KB
testcase_33 AC 223 ms
78,168 KB
testcase_34 AC 71 ms
71,076 KB
testcase_35 AC 72 ms
71,140 KB
testcase_36 AC 69 ms
71,184 KB
testcase_37 AC 69 ms
71,188 KB
testcase_38 AC 72 ms
71,164 KB
testcase_39 AC 104 ms
76,612 KB
testcase_40 AC 142 ms
77,384 KB
testcase_41 AC 100 ms
76,820 KB
testcase_42 AC 148 ms
77,388 KB
testcase_43 AC 107 ms
76,552 KB
testcase_44 AC 70 ms
71,128 KB
testcase_45 AC 70 ms
71,152 KB
testcase_46 AC 70 ms
71,124 KB
testcase_47 AC 71 ms
71,376 KB
testcase_48 AC 70 ms
71,256 KB
testcase_49 AC 70 ms
71,276 KB
testcase_50 AC 71 ms
71,396 KB
testcase_51 AC 72 ms
71,076 KB
testcase_52 AC 71 ms
71,240 KB
testcase_53 AC 71 ms
71,372 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

MOD = 998244353
N, M, K = map(int, input().split())

f = [0] * (M + 1)
f[1] = 1
cnt = [0] * (M + 1)
cnt[1] = 1
binom = 1

for m in range(1, M):
    binom *= N - m + 1
    binom *= pow(m, MOD - 2, MOD)
    binom %= MOD
    cnt.pop()
    cnt.insert(0, 0)
    for i in range(M - (M % 2 == 0), 0, -2):
        cnt[i] -= cnt[i + 1 >> 1]
        if cnt[i] < 0:
            cnt[i] += MOD
    for i in range(1, M + 1):
        cnt[i] += cnt[i - 1]
        if cnt[i] >= MOD:
            cnt[i] -= MOD
        f[i] += cnt[i] * binom

for i in range(M + 1):
    f[i] %= MOD

def mul(a, b):
    c = [0] * (M + 1)
    for i in range(1, M + 1):
        for j in range(1, M // i + 1):
            c[i * j] += a[i] * b[j]
    for i in range(M + 1):
        c[i] %= MOD
    return c

ans = [0] * (M + 1)
ans[1] = 1
while K:
    if K & 1:
        ans = mul(ans, f)
    K >>= 1
    f = mul(f, f)

print(sum(ans) % MOD)
0