結果

問題 No.1870 Xor Matrix
ユーザー se1ka2se1ka2
提出日時 2022-03-11 21:58:44
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 729 bytes
コンパイル時間 489 ms
コンパイル使用メモリ 68,012 KB
実行使用メモリ 4,376 KB
最終ジャッジ日時 2023-10-14 07:07:14
合計ジャッジ時間 3,010 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 2 ms
4,348 KB
testcase_03 AC 49 ms
4,372 KB
testcase_04 AC 77 ms
4,352 KB
testcase_05 AC 48 ms
4,352 KB
testcase_06 AC 56 ms
4,352 KB
testcase_07 AC 66 ms
4,348 KB
testcase_08 AC 69 ms
4,348 KB
testcase_09 AC 42 ms
4,348 KB
testcase_10 AC 58 ms
4,348 KB
testcase_11 AC 64 ms
4,368 KB
testcase_12 AC 66 ms
4,348 KB
testcase_13 AC 39 ms
4,352 KB
testcase_14 AC 76 ms
4,352 KB
testcase_15 AC 38 ms
4,348 KB
testcase_16 AC 44 ms
4,376 KB
testcase_17 AC 81 ms
4,356 KB
testcase_18 AC 58 ms
4,348 KB
testcase_19 AC 69 ms
4,352 KB
testcase_20 AC 51 ms
4,348 KB
testcase_21 AC 31 ms
4,348 KB
testcase_22 AC 46 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

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()
{
    ll 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