結果

問題 No.1836 Max Matrix
ユーザー 👑 hitonanodehitonanode
提出日時 2021-12-19 16:04:27
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 68 ms / 2,000 ms
コード長 577 bytes
コンパイル時間 6,319 ms
コンパイル使用メモリ 128,884 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-13 18:49:03
合計ジャッジ時間 7,980 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 59 ms
4,352 KB
testcase_03 AC 59 ms
4,348 KB
testcase_04 AC 33 ms
4,348 KB
testcase_05 AC 49 ms
4,352 KB
testcase_06 AC 36 ms
4,352 KB
testcase_07 AC 58 ms
4,348 KB
testcase_08 AC 17 ms
4,348 KB
testcase_09 AC 56 ms
4,352 KB
testcase_10 AC 38 ms
4,348 KB
testcase_11 AC 2 ms
4,348 KB
testcase_12 AC 68 ms
4,352 KB
testcase_13 AC 26 ms
4,348 KB
testcase_14 AC 31 ms
4,352 KB
testcase_15 AC 3 ms
4,352 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