結果

問題 No.1870 Xor Matrix
ユーザー ぷらぷら
提出日時 2021-12-10 23:10:06
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 582 bytes
コンパイル時間 2,015 ms
コンパイル使用メモリ 200,860 KB
実行使用メモリ 4,352 KB
最終ジャッジ日時 2023-10-14 05:18:38
合計ジャッジ時間 4,431 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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