結果

問題 No.1210 XOR Grid
ユーザー ianCKianCK
提出日時 2020-09-11 19:51:52
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 78 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 656 ms
コンパイル使用メモリ 27,084 KB
実行使用メモリ 6,148 KB
最終ジャッジ日時 2023-08-27 05:18:32
合計ジャッジ時間 8,323 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,384 KB
testcase_02 AC 1 ms
4,376 KB
testcase_03 AC 2 ms
4,376 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 2 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,380 KB
testcase_08 AC 2 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 AC 1 ms
4,380 KB
testcase_12 AC 2 ms
4,380 KB
testcase_13 AC 1 ms
4,380 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 1 ms
4,376 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 2 ms
4,376 KB
testcase_19 AC 1 ms
4,376 KB
testcase_20 AC 2 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 2 ms
4,380 KB
testcase_23 AC 1 ms
4,380 KB
testcase_24 AC 1 ms
4,380 KB
testcase_25 AC 39 ms
4,456 KB
testcase_26 AC 39 ms
4,580 KB
testcase_27 AC 40 ms
4,508 KB
testcase_28 AC 39 ms
4,568 KB
testcase_29 AC 39 ms
4,516 KB
testcase_30 AC 33 ms
4,376 KB
testcase_31 AC 39 ms
4,516 KB
testcase_32 AC 39 ms
4,504 KB
testcase_33 AC 1 ms
4,380 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 2 ms
4,384 KB
testcase_36 AC 17 ms
4,576 KB
testcase_37 AC 16 ms
4,540 KB
testcase_38 AC 17 ms
4,556 KB
testcase_39 AC 16 ms
4,404 KB
testcase_40 AC 31 ms
6,072 KB
testcase_41 AC 32 ms
6,088 KB
testcase_42 AC 78 ms
6,104 KB
testcase_43 AC 70 ms
6,136 KB
testcase_44 AC 78 ms
6,108 KB
testcase_45 AC 78 ms
6,068 KB
testcase_46 AC 75 ms
5,948 KB
testcase_47 AC 35 ms
6,148 KB
testcase_48 AC 34 ms
6,136 KB
testcase_49 AC 2 ms
4,380 KB
testcase_50 AC 46 ms
5,984 KB
testcase_51 AC 77 ms
6,008 KB
testcase_52 AC 68 ms
5,756 KB
testcase_53 AC 78 ms
5,944 KB
testcase_54 AC 34 ms
6,068 KB
testcase_55 AC 54 ms
6,068 KB
testcase_56 AC 40 ms
4,500 KB
testcase_57 AC 46 ms
5,428 KB
testcase_58 AC 2 ms
4,380 KB
testcase_59 AC 1 ms
4,376 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() {
	int n, m, x;
	scanf("%d%d%d", &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(Pow((1LL << x) % kMod, n - 1), m - 1));
}
0