結果

問題 No.1836 Max Matrix
ユーザー ntudantuda
提出日時 2022-04-07 17:14:13
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 282 ms / 2,000 ms
コード長 285 bytes
コンパイル時間 1,554 ms
コンパイル使用メモリ 86,700 KB
実行使用メモリ 76,220 KB
最終ジャッジ日時 2023-08-18 18:10:42
合計ジャッジ時間 4,134 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,384 KB
testcase_01 AC 71 ms
71,016 KB
testcase_02 AC 218 ms
76,016 KB
testcase_03 AC 226 ms
76,036 KB
testcase_04 AC 156 ms
76,148 KB
testcase_05 AC 201 ms
76,220 KB
testcase_06 AC 171 ms
76,096 KB
testcase_07 AC 224 ms
76,100 KB
testcase_08 AC 121 ms
76,096 KB
testcase_09 AC 225 ms
76,136 KB
testcase_10 AC 170 ms
76,092 KB
testcase_11 AC 70 ms
71,100 KB
testcase_12 AC 282 ms
76,108 KB
testcase_13 AC 136 ms
75,964 KB
testcase_14 AC 147 ms
76,020 KB
testcase_15 AC 80 ms
76,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

H, W, M = map(int, input().split())
MOD = 998244353
ans = 0
sumh = 0
sumw = 0
for a in range(1, M + 1):
    tmph = pow(a, H, MOD) - sumh
    tmpw = pow(a, W, MOD) - sumw
    ans += tmph * tmpw
    ans %= MOD
    sumh += tmph
    sumh %= MOD
    sumw += tmpw
    sumw %= MOD
print(ans)
0