結果

問題 No.1210 XOR Grid
ユーザー bachoppibachoppi
提出日時 2020-08-30 17:50:31
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 242 ms / 2,000 ms
コード長 975 bytes
コンパイル時間 1,726 ms
コンパイル使用メモリ 117,700 KB
実行使用メモリ 6,752 KB
最終ジャッジ日時 2023-08-09 17:53:02
合計ジャッジ時間 8,647 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,384 KB
testcase_01 AC 1 ms
4,380 KB
testcase_02 AC 1 ms
4,384 KB
testcase_03 AC 1 ms
4,388 KB
testcase_04 AC 2 ms
4,384 KB
testcase_05 AC 2 ms
4,384 KB
testcase_06 AC 1 ms
4,384 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,384 KB
testcase_10 AC 2 ms
4,380 KB
testcase_11 AC 1 ms
4,384 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,380 KB
testcase_15 AC 2 ms
4,384 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,384 KB
testcase_19 AC 2 ms
4,380 KB
testcase_20 AC 1 ms
4,380 KB
testcase_21 AC 2 ms
4,384 KB
testcase_22 AC 1 ms
4,384 KB
testcase_23 AC 1 ms
4,384 KB
testcase_24 AC 2 ms
4,384 KB
testcase_25 AC 125 ms
4,984 KB
testcase_26 AC 118 ms
4,956 KB
testcase_27 AC 118 ms
5,016 KB
testcase_28 AC 119 ms
5,024 KB
testcase_29 AC 120 ms
4,964 KB
testcase_30 AC 91 ms
4,816 KB
testcase_31 AC 124 ms
5,180 KB
testcase_32 AC 125 ms
5,016 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 1 ms
4,380 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 28 ms
4,924 KB
testcase_37 AC 28 ms
4,892 KB
testcase_38 AC 28 ms
4,912 KB
testcase_39 AC 27 ms
4,852 KB
testcase_40 AC 56 ms
6,520 KB
testcase_41 AC 54 ms
6,464 KB
testcase_42 AC 237 ms
6,752 KB
testcase_43 AC 208 ms
6,516 KB
testcase_44 AC 242 ms
6,668 KB
testcase_45 AC 236 ms
6,740 KB
testcase_46 AC 229 ms
6,604 KB
testcase_47 AC 54 ms
6,516 KB
testcase_48 AC 56 ms
6,584 KB
testcase_49 AC 2 ms
4,384 KB
testcase_50 AC 105 ms
6,420 KB
testcase_51 AC 235 ms
6,452 KB
testcase_52 AC 201 ms
6,212 KB
testcase_53 AC 242 ms
6,632 KB
testcase_54 AC 59 ms
6,448 KB
testcase_55 AC 148 ms
6,632 KB
testcase_56 AC 126 ms
4,976 KB
testcase_57 AC 130 ms
5,928 KB
testcase_58 AC 2 ms
4,384 KB
testcase_59 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp: 関数 ‘ll modpow(ll, ll, ll)’ 内:
main.cpp:34:1: 警告: 制御が非 void 関数の終りに到達しました [-Wreturn-type]
   34 | }
      | ^

ソースコード

diff #

#include<iostream>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;
#define PI 3.141592653589793

ll modpow(ll a, ll n, ll p){
	if(n==0) return 1;
	if(n%2) return (a*modpow(a, n-1, p))%p;
	if(!(n%2)){
		ll t=modpow(a, n/2, p);
		return (t*t)%p;
	}
}



int main(){
  ll n, m, x; cin >> n >> m >> x; ll a[n], b[m];
  ll tate=0, yoko=0;
  rep(i, n){
    cin >> a[i]; tate^=a[i];
  }
  rep(i, m){
    cin >> b[i]; yoko^=b[i];
  }
  if(tate!=yoko){
    cout << 0 << endl; 
  }
  else{
    cout << (ll)modpow(2, (m-1)*(n-1)*x, mod)%mod << endl;
  }
}
0