結果

問題 No.1142 XOR と XOR
ユーザー brthyyjpbrthyyjp
提出日時 2022-02-08 13:21:13
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 577 bytes
コンパイル時間 592 ms
コンパイル使用メモリ 87,220 KB
実行使用メモリ 124,112 KB
最終ジャッジ日時 2023-09-05 11:05:13
合計ジャッジ時間 6,798 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 96 ms
79,032 KB
testcase_01 AC 99 ms
74,772 KB
testcase_02 AC 97 ms
74,656 KB
testcase_03 AC 219 ms
112,012 KB
testcase_04 TLE -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m, k = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

from collections import Counter
mod = 10**9+7

CA = [0]
for a in A:
    CA.append(CA[-1]^a)
CB = [0]
for b in B:
    CB.append(CB[-1]^b)

DA = Counter()
SA = Counter()
for i, c in enumerate(CA):
    for j, v in SA.items():
        DA[j^c] += v
    SA[c] += 1

DB = Counter()
SB = Counter()
for i, c in enumerate(CB):
    for j, v in SB.items():
        DB[j^c] += v
    SB[c] += 1

ans = 0
for i in range((1<<10)+1):
    ans += DA[i]*DB[k^i]
    ans %= mod
print(ans)
0