結果

問題 No.1870 Xor Matrix
ユーザー ぷら
提出日時 2021-12-10 23:10:39
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 95 ms / 2,000 ms
コード長 588 bytes
コンパイル時間 1,939 ms
コンパイル使用メモリ 194,456 KB
最終ジャッジ日時 2025-01-26 07:31:26
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

long long modpow(long long a,long long b,long long m) {
    long long ans = 1;
    while(b) {
        if(b & 1) {
            (ans *= a) %= m;
        }
        (a *= a) %= m;
        b /= 2;
    }
    return ans;
}

int main() {
    long long n,m;
    cin >> n >> m;
    vector<int>a(n),b(m);
    int x = 0;
    for(int i = 0; i < n; i++) {
        cin >> a[i];
        x ^= a[i];
    }
    for(int i = 0; i < m; i++) {
        cin >> b[i];
        x ^= b[i];
    }
    cout << ((x == 0)?modpow(1 << 20,(n-1)*(m-1),998244353):0) << endl;
}
0