結果
問題 |
No.3255 01 Matrix Counting
|
ユーザー |
|
提出日時 | 2025-09-26 04:35:09 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 531 bytes |
コンパイル時間 | 3,077 ms |
コンパイル使用メモリ | 275,380 KB |
実行使用メモリ | 7,716 KB |
最終ジャッジ日時 | 2025-09-26 04:35:14 |
合計ジャッジ時間 | 4,088 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 14 |
ソースコード
// #pragma GCC optimize ("Ofast") // #pragma GCC optimize ("unroll-loops") // #pragma GCC target ("avx,avx2,fma") #include <bits/stdc++.h> using std::cin, std::cout, std::cerr; using ll = long long; const ll P = 998244353; ll Pow(ll a, ll b) { ll r = 1; for(; b; b /= 2) { if(b & 1) r = r * a % P; a = a * a % P; } return r; } int main() { std::ios::sync_with_stdio(false); ll n, m; cin >> n >> m; ll ans = Pow(2, n * m - 1 - (n - 2) - (m - 2)); cout << ans << '\n'; }