結果

問題 No.1142 XOR と XOR
ユーザー qumazakiqumazaki
提出日時 2020-09-08 18:31:24
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 670 bytes
コンパイル時間 1,274 ms
コンパイル使用メモリ 86,984 KB
実行使用メモリ 110,212 KB
最終ジャッジ日時 2023-08-20 03:17:15
合計ジャッジ時間 6,898 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
76,360 KB
testcase_01 AC 89 ms
76,392 KB
testcase_02 AC 89 ms
76,400 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 151 ms
110,212 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 89 ms
76,552 KB
testcase_12 AC 89 ms
76,440 KB
testcase_13 AC 90 ms
76,492 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 135 ms
108,844 KB
testcase_18 AC 100 ms
82,336 KB
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 124 ms
103,012 KB
testcase_26 AC 141 ms
103,896 KB
testcase_27 AC 135 ms
104,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m,k = map(int,input().split())
a = list(map(int,input().split()))
b = list(map(int,input().split()))
mod = 10**9+7

ax = [0]*1024
bx = [0]*1024
for xx,x in zip([ax,bx],[a,b]):
    tmp = 0
    # xx[0] += 1
    for xi in x:
        tmp = tmp^xi
        xx[tmp] += 1

ax2 = ax[::]
bx2 = bx[::]
for xx,xx2 in zip([ax,bx],[ax2,bx2]):
    for i in range(1024-1):
        for j in range(i,1024):
            if(i==j):
                xx2[0] += (xx[i]*(xx[i]-1))//2
                xx2[0] %= mod
            else:
                xx2[i ^ j] += xx[i]*xx[j]
                xx2[i ^ j] %= mod

ans = 0
for i in range(1024):
    ans += ax2[i] * bx2[k^i]
    ans %= mod

print(ans)
0