結果

問題 No.3255 01 Matrix Counting
コンテスト
ユーザー Gia Quyết
提出日時 2025-09-05 23:02:53
言語 C++17
(gcc 15.2.0 + boost 1.90.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 1 ms / 2,000 ms
+ 287µs
コード長 791 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,080 ms
コンパイル使用メモリ 208,724 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-07-14 16:29:35
合計ジャッジ時間 2,351 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define db double
#define gcd(a,b) __gcd(a,b)
#define lcm(a,b) a*b / __gcd(a,b)
#define I first
#define II second
#define pb push_back
#define ii pair<int,int>
const int INF = 2 * 1e9;
const int N = 2e5 + 1;
const int MOD = 998244353;
int pw(int a, int b) {
    int res = 1;
    while (b) {
        if (b & 1) res = (res * a) % MOD;
        b /= 2;
        a = (a * a) % MOD;
    }
    return res;
}
int32_t main()
{
    #define TASKNAME "test"
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    if (fopen(TASKNAME ".inp","r" ))
    {
        freopen(TASKNAME ".inp","r",stdin);
        freopen(TASKNAME ".out","w",stdout);
    }
    int h, w;
    cin >> h >> w;
    cout << pw(2, (h - 1) * (w - 1) + 2);
    return 0;
}
0