結果

問題 No.1210 XOR Grid
ユーザー shotoyooshotoyoo
提出日時 2020-08-30 16:09:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 369 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 775 ms
コンパイル使用メモリ 82,380 KB
実行使用メモリ 268,300 KB
最終ジャッジ日時 2024-04-27 09:47:39
合計ジャッジ時間 10,201 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
52,740 KB
testcase_01 AC 40 ms
52,776 KB
testcase_02 AC 43 ms
53,028 KB
testcase_03 AC 41 ms
52,336 KB
testcase_04 AC 40 ms
52,532 KB
testcase_05 AC 40 ms
52,000 KB
testcase_06 AC 45 ms
52,884 KB
testcase_07 AC 42 ms
53,152 KB
testcase_08 AC 41 ms
52,136 KB
testcase_09 AC 41 ms
52,680 KB
testcase_10 AC 43 ms
52,332 KB
testcase_11 AC 48 ms
52,652 KB
testcase_12 AC 42 ms
53,428 KB
testcase_13 AC 41 ms
52,480 KB
testcase_14 AC 41 ms
52,692 KB
testcase_15 AC 39 ms
53,020 KB
testcase_16 AC 38 ms
53,400 KB
testcase_17 AC 39 ms
52,824 KB
testcase_18 AC 39 ms
52,140 KB
testcase_19 AC 39 ms
52,212 KB
testcase_20 AC 37 ms
53,420 KB
testcase_21 AC 39 ms
52,548 KB
testcase_22 AC 39 ms
52,988 KB
testcase_23 AC 39 ms
52,672 KB
testcase_24 AC 38 ms
53,104 KB
testcase_25 AC 239 ms
199,724 KB
testcase_26 AC 222 ms
195,956 KB
testcase_27 AC 221 ms
195,964 KB
testcase_28 AC 222 ms
197,292 KB
testcase_29 AC 106 ms
108,204 KB
testcase_30 AC 98 ms
98,232 KB
testcase_31 AC 104 ms
108,460 KB
testcase_32 AC 107 ms
107,792 KB
testcase_33 AC 38 ms
53,316 KB
testcase_34 AC 38 ms
52,956 KB
testcase_35 AC 39 ms
52,004 KB
testcase_36 AC 196 ms
188,376 KB
testcase_37 AC 184 ms
182,332 KB
testcase_38 AC 197 ms
192,768 KB
testcase_39 AC 135 ms
145,428 KB
testcase_40 AC 299 ms
260,080 KB
testcase_41 AC 314 ms
260,812 KB
testcase_42 AC 369 ms
267,852 KB
testcase_43 AC 334 ms
259,100 KB
testcase_44 AC 366 ms
267,792 KB
testcase_45 AC 367 ms
268,300 KB
testcase_46 AC 352 ms
265,236 KB
testcase_47 AC 105 ms
115,008 KB
testcase_48 AC 103 ms
114,988 KB
testcase_49 AC 41 ms
58,840 KB
testcase_50 AC 191 ms
170,932 KB
testcase_51 AC 160 ms
134,632 KB
testcase_52 AC 153 ms
129,288 KB
testcase_53 AC 153 ms
128,328 KB
testcase_54 AC 105 ms
114,964 KB
testcase_55 AC 143 ms
134,488 KB
testcase_56 AC 118 ms
110,872 KB
testcase_57 AC 135 ms
125,880 KB
testcase_58 AC 40 ms
53,284 KB
testcase_59 AC 39 ms
52,400 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


n,m,x = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
M = 10**9+7
def sub(a,b):
    xa = 0
    xb = 0
    for num in a:
        xa ^= num
    for num in b:
        xb ^= num
    if xa!=xb:
        return 0
    else:
        return pow(2,len(a)*len(b)-(len(a)+len(b))+1,M)
ans = 1
for i in range(x):
    res = sub([(item>>i)&1 for item in a], [(item>>i)&1 for item in b])
    if res == 0:
        ans = 0
        break
    else:
        ans *= res
        ans %= M
print(ans)
0