結果

問題 No.1836 Max Matrix
ユーザー 👑 hitonanodehitonanode
提出日時 2021-12-19 16:04:21
言語 C++23
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 64 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 7,768 ms
コンパイル使用メモリ 235,220 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 18:48:52
合計ジャッジ時間 8,394 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 56 ms
4,348 KB
testcase_03 AC 56 ms
4,352 KB
testcase_04 AC 31 ms
4,348 KB
testcase_05 AC 46 ms
4,348 KB
testcase_06 AC 35 ms
4,352 KB
testcase_07 AC 53 ms
4,348 KB
testcase_08 AC 16 ms
4,352 KB
testcase_09 AC 53 ms
4,348 KB
testcase_10 AC 36 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 64 ms
4,352 KB
testcase_13 AC 23 ms
4,352 KB
testcase_14 AC 29 ms
4,348 KB
testcase_15 AC 3 ms
4,348 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

// Validator
#include "testlib.h"

#include <cstdio>
#include <atcoder/modint>
using mint = atcoder::modint998244353;

int main(int argc, char **argv) {
    registerValidation(argc, argv);
    int H = inf.readInt(1, 200000);
    inf.readSpace();
    int W = inf.readInt(1, 200000);
    inf.readSpace();
    int M = inf.readInt(1, 200000);
    inf.readEoln();
    inf.readEof();

    mint ret = 0;
    for (int lo = 1; lo < M; ++lo) ret += (mint(M - lo + 1).pow(H) - mint(M - lo).pow(H)) * (mint(M - lo + 1).pow(W) - mint(M - lo).pow(W));
    printf("%d\n", (ret + 1).val());
}
0