結果

問題 No.1210 XOR Grid
ユーザー auauaauaua
提出日時 2020-08-30 17:06:02
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 250 ms / 2,000 ms
コード長 1,139 bytes
コンパイル時間 2,208 ms
コンパイル使用メモリ 166,652 KB
実行使用メモリ 6,508 KB
最終ジャッジ日時 2023-08-09 16:34:49
合計ジャッジ時間 8,768 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,376 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 1 ms
4,380 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 2 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 2 ms
4,376 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,384 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,376 KB
testcase_25 AC 123 ms
4,692 KB
testcase_26 AC 122 ms
4,748 KB
testcase_27 AC 120 ms
4,612 KB
testcase_28 AC 122 ms
4,600 KB
testcase_29 AC 120 ms
4,644 KB
testcase_30 AC 93 ms
4,612 KB
testcase_31 AC 118 ms
4,640 KB
testcase_32 AC 128 ms
4,556 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,380 KB
testcase_35 AC 1 ms
4,380 KB
testcase_36 AC 28 ms
4,572 KB
testcase_37 AC 27 ms
4,600 KB
testcase_38 AC 28 ms
4,780 KB
testcase_39 AC 28 ms
4,744 KB
testcase_40 AC 56 ms
6,328 KB
testcase_41 AC 55 ms
6,508 KB
testcase_42 AC 248 ms
6,292 KB
testcase_43 AC 215 ms
6,256 KB
testcase_44 AC 250 ms
6,284 KB
testcase_45 AC 245 ms
6,136 KB
testcase_46 AC 241 ms
6,224 KB
testcase_47 AC 57 ms
6,472 KB
testcase_48 AC 59 ms
6,188 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 113 ms
6,168 KB
testcase_51 AC 240 ms
6,184 KB
testcase_52 AC 200 ms
6,016 KB
testcase_53 AC 249 ms
6,136 KB
testcase_54 AC 60 ms
6,196 KB
testcase_55 AC 150 ms
6,136 KB
testcase_56 AC 128 ms
4,640 KB
testcase_57 AC 127 ms
5,440 KB
testcase_58 AC 2 ms
4,376 KB
testcase_59 AC 1 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,m,n) for(int i=(m);i<(n);i++)
#define rep(i,n) REP(i,0,n)
#define pb push_back
#define all(a) a.begin(),a.end()
#define rall(c) (c).rbegin(),(c).rend()
#define mp make_pair
#define endl '\n'
#define vec vector<ll>
#define mat vector<vector<ll> >
#define fi first
#define se second
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef complex<double> comp;
const ll inf=1e9+7;
const ll mod=1e9+7;
const int MAX=200010;

ll rui(ll a,ll b){
    ll res=1;
    ll x=a;
    while(b){
        if(b&1)res=res*x%mod;
        b/=2;
        x=x*x%mod;
    }
    return res;
}

signed main(){
    ll 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 B=0;
        rep(i,m){
            B^=b[i];
        }
    
    
        ll A=0;
        rep(i,n){
            A^=a[i];
        }
    if(A==B)
    {
        ll d=rui(2LL,(n-1)*(m-1))%mod;
        ll ans=rui(d,x);
        if(ans<0)ans+=mod;
        cout<<ans<<endl;
    }else{
        cout<<0<<endl;
    }
}
0