結果

問題 No.1836 Max Matrix
ユーザー 👑 NachiaNachia
提出日時 2022-02-11 23:25:47
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 33 ms / 2,000 ms
コード長 875 bytes
コンパイル時間 901 ms
コンパイル使用メモリ 79,676 KB
実行使用メモリ 4,840 KB
最終ジャッジ日時 2023-09-10 06:18:41
合計ジャッジ時間 2,221 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 28 ms
4,656 KB
testcase_03 AC 29 ms
4,840 KB
testcase_04 AC 16 ms
4,380 KB
testcase_05 AC 24 ms
4,392 KB
testcase_06 AC 19 ms
4,384 KB
testcase_07 AC 27 ms
4,384 KB
testcase_08 AC 9 ms
4,380 KB
testcase_09 AC 27 ms
4,604 KB
testcase_10 AC 18 ms
4,380 KB
testcase_11 AC 2 ms
4,384 KB
testcase_12 AC 33 ms
4,636 KB
testcase_13 AC 13 ms
4,584 KB
testcase_14 AC 16 ms
4,572 KB
testcase_15 AC 4 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <atcoder/modint>
using namespace std;


using i64 = long long;
using u64 = unsigned long long;
using i32 = int;
using u32 = unsigned int;
#define rep(i,n) for(int i=0; i<(int)(n); i++)

using modint = atcoder::static_modint<998244353>;



int main() {
    int H,W,M; cin >> H >> W >> M;

    vector<modint> A(M+1);
    rep(i,M+1) A[i] = modint(i).pow(H);
    for(int i=M; i>=1; i--) A[i] -= A[i-1];
    
    vector<modint> B(M+1);
    rep(i,M+1) B[i] = modint(i).pow(W);
    for(int i=M; i>=1; i--) B[i] -= B[i-1];

    modint ans = 0;
    for(int minC=0; minC<M; minC++) ans += A[M-minC] * B[M-minC];
    cout << ans.val() << endl;
    return 0;
}




struct ios_do_not_sync{
    ios_do_not_sync(){
        std::ios::sync_with_stdio(false);
        std::cin.tie(nullptr);
    }
} ios_do_not_sync_instance;
0