結果

問題 No.1210 XOR Grid
ユーザー V_Melville
提出日時 2024-11-13 00:27:55
言語 C++23
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 5,192 ms
コンパイル使用メモリ 308,928 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-11-13 00:28:06
合計ジャッジ時間 10,823 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 43 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#if __has_include(<atcoder/all>)
#include <atcoder/all>
using namespace atcoder;
#endif
#define rep(i, n) for (int i = 0; i < (n); ++i)

using namespace std;
using ll = long long;
using mint = modint1000000007;

int main() {
    int n, m, x;
    cin >> n >> m >> x;
    
    vector<int> a(n), b(m);
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];
    
    int as = 0;
    rep(i, n) as ^= a[i];
    int bs = 0;
    rep(i, m) bs ^= b[i];
    
    if (as != bs) {
        puts("0");
        return 0;
    } 
    
    mint ans = mint(1ll<<x).pow(ll(n-1)*(m-1));
    cout << ans.val() << '\n';
    
    return 0;
}
0