結果

問題 No.1870 Xor Matrix
ユーザー hiikunZhiikunZ
提出日時 2022-03-11 21:47:48
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 81 ms / 2,000 ms
コード長 1,094 bytes
コンパイル時間 1,939 ms
コンパイル使用メモリ 202,312 KB
実行使用メモリ 5,264 KB
最終ジャッジ日時 2023-10-14 06:51:53
合計ジャッジ時間 4,368 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 48 ms
4,364 KB
testcase_04 AC 76 ms
5,144 KB
testcase_05 AC 48 ms
4,428 KB
testcase_06 AC 56 ms
4,852 KB
testcase_07 AC 66 ms
4,568 KB
testcase_08 AC 67 ms
4,896 KB
testcase_09 AC 41 ms
4,352 KB
testcase_10 AC 57 ms
4,568 KB
testcase_11 AC 64 ms
4,740 KB
testcase_12 AC 66 ms
4,984 KB
testcase_13 AC 38 ms
4,352 KB
testcase_14 AC 76 ms
4,952 KB
testcase_15 AC 37 ms
4,352 KB
testcase_16 AC 44 ms
4,348 KB
testcase_17 AC 81 ms
5,264 KB
testcase_18 AC 58 ms
4,620 KB
testcase_19 AC 70 ms
4,904 KB
testcase_20 AC 50 ms
4,620 KB
testcase_21 AC 31 ms
4,352 KB
testcase_22 AC 47 ms
4,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
//#include<atcoder/all>
//using namespace atcoder;
using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
constexpr ll MAX = 2000000000000000000;
constexpr ld PI = 3.14159265358979;
constexpr ll MOD = 998244353;//2024948111;
ld dotorad(ld K){return PI * K / 180.0;}
ld radtodo(ld K){return K * 180.0 / PI;}
mt19937 mt;
void randinit(){srand((unsigned)time(NULL));mt = mt19937(rand());}
ll modpow(ll A,ll B,ll M){
    ll r = 1,p = A;
    while(B > 0){
        if(B % 2 == 1) r = (r * p) % M;
        p = (p * p) % M;
        B /= 2;
    }
    return r;
}
int main(){
    ll N,M;
    cin >> N >> M;
    vector<ll> A(N),B(M);
    for(ll i = 0;i < N;i++) cin >> A[i];
    for(ll i = 0;i < M;i++) cin >> B[i];
    ll x = 0;
    for(ll i = 0;i < N;i++) x ^= A[i];
    for(ll i = 0;i < M;i++) x ^= B[i];
    if(x != 0) cout << 0 << endl;
    else{
        ll ans = 1;
        for(ll i = 0;i < 20;i++){
            ans *= modpow(2,(N - 1) * (M - 1),MOD);
            ans %= MOD;
        }
        cout << ans << endl;
    }
}
0