結果
| 問題 |
No.1836 Max Matrix
|
| コンテスト | |
| ユーザー |
Nachia
|
| 提出日時 | 2022-02-11 23:25:47 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 35 ms / 2,000 ms |
| コード長 | 875 bytes |
| コンパイル時間 | 961 ms |
| コンパイル使用メモリ | 78,356 KB |
| 最終ジャッジ日時 | 2025-01-27 22:11:35 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#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;
Nachia