結果

問題 No.1870 Xor Matrix
コンテスト
ユーザー ぷら
提出日時 2021-12-10 23:10:39
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 53 ms / 2,000 ms
+ 999µs
コード長 588 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,319 ms
コンパイル使用メモリ 218,100 KB
実行使用メモリ 9,904 KB
最終ジャッジ日時 2026-11-27 22:35:02
合計ジャッジ時間 4,356 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#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