結果

問題 No.1210 XOR Grid
ユーザー msm1993msm1993
提出日時 2020-10-08 10:11:35
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 74 ms / 2,000 ms
コード長 604 bytes
コンパイル時間 201 ms
コンパイル使用メモリ 32,232 KB
実行使用メモリ 6,132 KB
最終ジャッジ日時 2023-09-27 11:42:02
合計ジャッジ時間 7,209 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,376 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,380 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 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 1 ms
4,380 KB
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 1 ms
4,380 KB
testcase_15 AC 2 ms
4,380 KB
testcase_16 AC 1 ms
4,376 KB
testcase_17 AC 1 ms
4,380 KB
testcase_18 AC 1 ms
4,376 KB
testcase_19 AC 2 ms
4,376 KB
testcase_20 AC 1 ms
4,376 KB
testcase_21 AC 1 ms
4,376 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 1 ms
4,376 KB
testcase_24 AC 2 ms
4,380 KB
testcase_25 AC 38 ms
4,584 KB
testcase_26 AC 38 ms
4,576 KB
testcase_27 AC 37 ms
4,488 KB
testcase_28 AC 38 ms
4,492 KB
testcase_29 AC 36 ms
4,420 KB
testcase_30 AC 30 ms
4,384 KB
testcase_31 AC 36 ms
4,400 KB
testcase_32 AC 37 ms
4,496 KB
testcase_33 AC 2 ms
4,380 KB
testcase_34 AC 1 ms
4,376 KB
testcase_35 AC 2 ms
4,380 KB
testcase_36 AC 15 ms
4,580 KB
testcase_37 AC 16 ms
4,572 KB
testcase_38 AC 16 ms
4,576 KB
testcase_39 AC 15 ms
4,500 KB
testcase_40 AC 29 ms
6,132 KB
testcase_41 AC 30 ms
5,972 KB
testcase_42 AC 74 ms
6,084 KB
testcase_43 AC 65 ms
6,080 KB
testcase_44 AC 73 ms
6,108 KB
testcase_45 AC 72 ms
6,072 KB
testcase_46 AC 72 ms
6,008 KB
testcase_47 AC 31 ms
5,992 KB
testcase_48 AC 31 ms
6,048 KB
testcase_49 AC 1 ms
4,380 KB
testcase_50 AC 42 ms
6,132 KB
testcase_51 AC 72 ms
6,048 KB
testcase_52 AC 63 ms
5,608 KB
testcase_53 AC 72 ms
6,088 KB
testcase_54 AC 31 ms
6,076 KB
testcase_55 AC 50 ms
6,044 KB
testcase_56 AC 38 ms
4,380 KB
testcase_57 AC 41 ms
5,340 KB
testcase_58 AC 2 ms
4,380 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() {
	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