結果

問題 No.1210 XOR Grid
ユーザー shotoyooshotoyoo
提出日時 2020-08-30 16:09:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 425 ms / 2,000 ms
コード長 675 bytes
コンパイル時間 1,793 ms
コンパイル使用メモリ 86,812 KB
実行使用メモリ 266,948 KB
最終ジャッジ日時 2023-08-09 14:53:40
合計ジャッジ時間 14,637 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,268 KB
testcase_01 AC 74 ms
71,268 KB
testcase_02 AC 72 ms
71,356 KB
testcase_03 AC 75 ms
71,136 KB
testcase_04 AC 74 ms
71,204 KB
testcase_05 AC 73 ms
71,164 KB
testcase_06 AC 74 ms
71,136 KB
testcase_07 AC 75 ms
71,264 KB
testcase_08 AC 75 ms
70,984 KB
testcase_09 AC 75 ms
71,400 KB
testcase_10 AC 78 ms
71,160 KB
testcase_11 AC 77 ms
70,844 KB
testcase_12 AC 74 ms
71,156 KB
testcase_13 AC 74 ms
70,984 KB
testcase_14 AC 75 ms
71,168 KB
testcase_15 AC 74 ms
71,172 KB
testcase_16 AC 75 ms
71,208 KB
testcase_17 AC 74 ms
71,260 KB
testcase_18 AC 73 ms
71,204 KB
testcase_19 AC 75 ms
71,276 KB
testcase_20 AC 75 ms
71,188 KB
testcase_21 AC 74 ms
71,320 KB
testcase_22 AC 75 ms
71,292 KB
testcase_23 AC 76 ms
71,276 KB
testcase_24 AC 73 ms
71,296 KB
testcase_25 AC 273 ms
199,688 KB
testcase_26 AC 255 ms
197,804 KB
testcase_27 AC 264 ms
197,592 KB
testcase_28 AC 264 ms
199,204 KB
testcase_29 AC 144 ms
110,132 KB
testcase_30 AC 129 ms
101,368 KB
testcase_31 AC 142 ms
110,304 KB
testcase_32 AC 139 ms
109,236 KB
testcase_33 AC 77 ms
71,028 KB
testcase_34 AC 74 ms
71,188 KB
testcase_35 AC 75 ms
70,824 KB
testcase_36 AC 230 ms
195,036 KB
testcase_37 AC 226 ms
188,808 KB
testcase_38 AC 234 ms
197,760 KB
testcase_39 AC 176 ms
150,828 KB
testcase_40 AC 348 ms
262,680 KB
testcase_41 AC 365 ms
263,428 KB
testcase_42 AC 425 ms
256,836 KB
testcase_43 AC 367 ms
260,676 KB
testcase_44 AC 422 ms
256,508 KB
testcase_45 AC 420 ms
256,616 KB
testcase_46 AC 400 ms
266,948 KB
testcase_47 AC 135 ms
110,192 KB
testcase_48 AC 138 ms
110,204 KB
testcase_49 AC 78 ms
75,344 KB
testcase_50 AC 230 ms
172,152 KB
testcase_51 AC 201 ms
135,480 KB
testcase_52 AC 188 ms
128,100 KB
testcase_53 AC 191 ms
128,588 KB
testcase_54 AC 137 ms
110,328 KB
testcase_55 AC 176 ms
135,640 KB
testcase_56 AC 153 ms
112,156 KB
testcase_57 AC 171 ms
126,652 KB
testcase_58 AC 73 ms
71,228 KB
testcase_59 AC 74 ms
71,212 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