結果

問題 No.1870 Xor Matrix
ユーザー umezoumezo
提出日時 2022-03-12 02:32:05
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 28 ms / 2,000 ms
コード長 618 bytes
コンパイル時間 1,800 ms
コンパイル使用メモリ 201,632 KB
実行使用メモリ 5,156 KB
最終ジャッジ日時 2023-10-14 12:39:22
合計ジャッジ時間 5,127 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,348 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 17 ms
4,432 KB
testcase_04 AC 27 ms
5,156 KB
testcase_05 AC 17 ms
4,372 KB
testcase_06 AC 20 ms
4,612 KB
testcase_07 AC 23 ms
4,868 KB
testcase_08 AC 24 ms
4,936 KB
testcase_09 AC 15 ms
4,356 KB
testcase_10 AC 20 ms
4,660 KB
testcase_11 AC 22 ms
4,608 KB
testcase_12 AC 23 ms
4,892 KB
testcase_13 AC 14 ms
4,376 KB
testcase_14 AC 26 ms
5,100 KB
testcase_15 AC 14 ms
4,352 KB
testcase_16 AC 16 ms
4,352 KB
testcase_17 AC 28 ms
5,156 KB
testcase_18 AC 21 ms
4,608 KB
testcase_19 AC 24 ms
4,892 KB
testcase_20 AC 18 ms
4,484 KB
testcase_21 AC 12 ms
4,352 KB
testcase_22 AC 17 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define ALL(v) v.begin(),v.end()
typedef long long ll;

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

const int MOD=998244353;
ll modpow(ll x,ll n){
  ll ans=1;
  while(n){
    if(n&1) ans=ans*x%MOD;
    x=x*x%MOD;
    n/=2;
  }
  return ans;
}

int main(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);

  ll n,m;
  cin>>n>>m;
  vector<ll> A(n),B(m);
  rep(i,n) cin>>A[i];
  rep(i,m) cin>>B[i];
  ll a=0,b=0;
  rep(i,n) a^=A[i];
  rep(i,m) b^=B[i];
  if(a!=b){
    cout<<0<<endl;
    return 0;
  }
  cout<<modpow(modpow(2,(m-1)*(n-1)),20)<<endl;
  
  return 0;
}
0