結果

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

ソースコード

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