結果

問題 No.1870 Xor Matrix
ユーザー se1ka2se1ka2
提出日時 2022-03-11 21:58:14
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 730 bytes
コンパイル時間 484 ms
コンパイル使用メモリ 66,948 KB
実行使用メモリ 4,476 KB
最終ジャッジ日時 2023-10-14 07:05:53
合計ジャッジ時間 2,891 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 1 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 WA -
testcase_04 AC 76 ms
4,348 KB
testcase_05 AC 48 ms
4,352 KB
testcase_06 AC 56 ms
4,348 KB
testcase_07 AC 67 ms
4,348 KB
testcase_08 WA -
testcase_09 AC 41 ms
4,352 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 67 ms
4,352 KB
testcase_13 AC 39 ms
4,348 KB
testcase_14 AC 75 ms
4,348 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 81 ms
4,352 KB
testcase_18 WA -
testcase_19 AC 70 ms
4,348 KB
testcase_20 AC 51 ms
4,352 KB
testcase_21 AC 31 ms
4,352 KB
testcase_22 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
using namespace std;
typedef long long ll;

const ll MOD = 998244353;

long long modpow(long long x, long long n){
    long long  res = 1;
    long long mul = x;
    while(n){
        if(n % 2) res = res * mul % MOD;
        mul = mul * mul % MOD;
        n /= 2;
    }
    return res;
}

int main()
{
    int n, m;
	cin >> n >> m;
    int c[22]{0};
    for(int i = 0; i < n + m; i++){
        int a;
        cin >> a;
        for(int j = 0; j < 20; j++){
            c[j] += (a >> j) & 1;
        }
    }
    bool f = true;
    for(int j = 0; j < 20; j++){
        if(c[j] % 2) f = false;
    }
    if(!f) cout << 0 << endl;
	else cout << modpow(modpow(2, (n - 1) * (m - 1)), 20) << endl;
}
0