結果
| 問題 | No.1210 XOR Grid | 
| コンテスト | |
| ユーザー |  | 
| 提出日時 | 2024-11-13 00:30:44 | 
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 294 ms / 2,000 ms | 
| コード長 | 637 bytes | 
| コンパイル時間 | 5,723 ms | 
| コンパイル使用メモリ | 308,720 KB | 
| 実行使用メモリ | 6,820 KB | 
| 最終ジャッジ日時 | 2024-11-13 00:30:57 | 
| 合計ジャッジ時間 | 12,834 ms | 
| ジャッジサーバーID (参考情報) | judge3 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 57 | 
ソースコード
#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<ll> a(n), b(m);
    rep(i, n) cin >> a[i];
    rep(i, m) cin >> b[i];
    
    ll as = 0;
    rep(i, n) as ^= a[i];
    ll 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;
}
            
            
            
        