結果
問題 | No.1142 XOR と XOR |
ユーザー | vwxyz |
提出日時 | 2024-04-14 11:34:44 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 572 bytes |
コンパイル時間 | 806 ms |
コンパイル使用メモリ | 82,308 KB |
実行使用メモリ | 116,248 KB |
最終ジャッジ日時 | 2024-04-14 11:34:50 |
合計ジャッジ時間 | 5,462 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 54 ms
60,996 KB |
testcase_01 | AC | 54 ms
61,024 KB |
testcase_02 | WA | - |
testcase_03 | AC | 134 ms
109,504 KB |
testcase_04 | RE | - |
testcase_05 | RE | - |
testcase_06 | RE | - |
testcase_07 | AC | 126 ms
116,248 KB |
testcase_08 | AC | 133 ms
110,432 KB |
testcase_09 | AC | 131 ms
110,260 KB |
testcase_10 | AC | 132 ms
110,432 KB |
testcase_11 | RE | - |
testcase_12 | WA | - |
testcase_13 | RE | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | RE | - |
testcase_17 | AC | 113 ms
110,816 KB |
testcase_18 | AC | 69 ms
76,612 KB |
testcase_19 | WA | - |
testcase_20 | RE | - |
testcase_21 | WA | - |
testcase_22 | RE | - |
testcase_23 | WA | - |
testcase_24 | RE | - |
testcase_25 | WA | - |
testcase_26 | WA | - |
testcase_27 | WA | - |
ソースコード
N,M,K=map(int,input().split()) X=1<<10 mod=10**9+7 A=[0]+list(map(int,input().split())) B=[0]+list(map(int,input().split())) for i in range(1,N+1): A[i]^=A[i-1] B[i]^=B[i-1] cntA=[0]*X cntB=[0]*X for a in A: cntA[a]+=1 for b in B: cntB[b]+=1 A=[0]*X B=[0]*X for a0 in range(X): for a1 in range(X): A[a0^a1]+=cntA[a0]*cntA[a1] for b0 in range(X): for b1 in range(X): B[b0^b1]+=cntB[b0]*cntB[b1] A[0]-=N+1 B[0]-=M+1 for x in range(X): A[x]//=2 B[x]//=2 ans=0 for x in range(X): ans+=A[x]*B[x^K]%mod ans%=mod print(ans)