結果

問題 No.1210 XOR Grid
ユーザー ianCKianCK
提出日時 2020-09-11 19:53:11
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 622 bytes
コンパイル時間 263 ms
コンパイル使用メモリ 27,148 KB
実行使用メモリ 6,160 KB
最終ジャッジ日時 2023-08-27 05:20:06
合計ジャッジ時間 5,005 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 2 ms
4,376 KB
testcase_03 AC 1 ms
4,376 KB
testcase_04 AC 1 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,384 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 1 ms
4,376 KB
testcase_11 AC 1 ms
4,376 KB
testcase_12 AC 1 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,380 KB
testcase_17 AC 2 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,380 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,376 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 40 ms
4,480 KB
testcase_26 AC 39 ms
4,536 KB
testcase_27 AC 39 ms
4,592 KB
testcase_28 AC 39 ms
4,548 KB
testcase_29 AC 39 ms
4,516 KB
testcase_30 AC 32 ms
4,380 KB
testcase_31 AC 39 ms
4,408 KB
testcase_32 AC 39 ms
4,504 KB
testcase_33 AC 2 ms
4,376 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 1 ms
4,376 KB
testcase_36 AC 17 ms
4,576 KB
testcase_37 AC 16 ms
4,592 KB
testcase_38 AC 16 ms
4,580 KB
testcase_39 AC 16 ms
4,568 KB
testcase_40 AC 32 ms
6,160 KB
testcase_41 AC 31 ms
6,088 KB
testcase_42 AC 78 ms
6,132 KB
testcase_43 AC 70 ms
6,136 KB
testcase_44 AC 78 ms
6,040 KB
testcase_45 AC 77 ms
6,132 KB
testcase_46 AC 76 ms
6,072 KB
testcase_47 AC 34 ms
6,104 KB
testcase_48 AC 34 ms
6,036 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 46 ms
6,116 KB
testcase_51 AC 77 ms
5,980 KB
testcase_52 AC 67 ms
5,720 KB
testcase_53 AC 77 ms
5,964 KB
testcase_54 AC 33 ms
6,160 KB
testcase_55 AC 54 ms
6,076 KB
testcase_56 AC 40 ms
4,476 KB
testcase_57 AC 45 ms
5,444 KB
testcase_58 AC 2 ms
4,376 KB
testcase_59 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>

typedef long long int ll;
constexpr int kMod = int(1E9 + 7), kN = int(2E5 + 10);

ll Pow(ll a, ll b) {
	ll ans = 1;
	while (b) {
		if (b & 1) ans = ans * a % kMod;
		a = a * a % kMod;
		b >>= 1;
	}
	return ans;
}

ll a[kN], b[kN];

int main() {
	ll n, m, x;
	scanf("%lld%lld%lld", &n, &m, &x);
	for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
	for (int i = 1; i <= m; i++) scanf("%lld", &b[i]);
	for (int i = 2; i <= n; i++) b[1] ^= a[i];
	for (int i = 2; i <= m; i++) a[1] ^= b[i];
	if (a[1] != b[1]) printf("0\n");
	else printf("%lld\n", Pow((1LL << x) % kMod, (n - 1) * (m - 1) % (kMod - 1)));
}
0