結果

問題 No.1210 XOR Grid
ユーザー auauaauaua
提出日時 2020-08-30 16:56:07
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,291 bytes
コンパイル時間 1,534 ms
コンパイル使用メモリ 171,008 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-27 10:20:55
合計ジャッジ時間 8,012 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,816 KB
testcase_01 AC 2 ms
6,940 KB
testcase_02 AC 2 ms
6,940 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 AC 2 ms
6,944 KB
testcase_06 AC 2 ms
6,940 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 2 ms
6,944 KB
testcase_09 AC 2 ms
6,944 KB
testcase_10 AC 2 ms
6,944 KB
testcase_11 AC 2 ms
6,940 KB
testcase_12 AC 2 ms
6,944 KB
testcase_13 AC 1 ms
6,940 KB
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 2 ms
6,944 KB
testcase_16 AC 1 ms
6,944 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 AC 2 ms
6,940 KB
testcase_19 AC 2 ms
6,944 KB
testcase_20 AC 2 ms
6,944 KB
testcase_21 AC 2 ms
6,944 KB
testcase_22 WA -
testcase_23 AC 2 ms
6,944 KB
testcase_24 AC 2 ms
6,944 KB
testcase_25 AC 136 ms
6,944 KB
testcase_26 AC 133 ms
6,940 KB
testcase_27 AC 134 ms
6,940 KB
testcase_28 AC 133 ms
6,944 KB
testcase_29 AC 134 ms
6,940 KB
testcase_30 AC 103 ms
6,940 KB
testcase_31 WA -
testcase_32 WA -
testcase_33 AC 2 ms
6,944 KB
testcase_34 AC 2 ms
6,944 KB
testcase_35 AC 2 ms
6,940 KB
testcase_36 AC 32 ms
6,940 KB
testcase_37 AC 32 ms
6,944 KB
testcase_38 AC 32 ms
6,940 KB
testcase_39 AC 31 ms
6,940 KB
testcase_40 AC 63 ms
6,944 KB
testcase_41 AC 61 ms
6,940 KB
testcase_42 AC 270 ms
6,944 KB
testcase_43 AC 230 ms
6,940 KB
testcase_44 AC 275 ms
6,944 KB
testcase_45 AC 274 ms
6,940 KB
testcase_46 AC 263 ms
6,940 KB
testcase_47 AC 65 ms
6,940 KB
testcase_48 AC 64 ms
6,940 KB
testcase_49 AC 2 ms
6,944 KB
testcase_50 AC 125 ms
6,940 KB
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 AC 64 ms
6,944 KB
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
権限があれば一括ダウンロードができます

ソースコード

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

}
0