結果
問題 | No.1142 XOR と XOR |
ユーザー | None |
提出日時 | 2021-02-27 18:14:55 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 535 bytes |
コンパイル時間 | 252 ms |
コンパイル使用メモリ | 82,556 KB |
実行使用メモリ | 112,188 KB |
最終ジャッジ日時 | 2024-04-10 15:46:45 |
合計ジャッジ時間 | 5,194 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
60,952 KB |
testcase_01 | AC | 37 ms
55,176 KB |
testcase_02 | AC | 42 ms
61,372 KB |
testcase_03 | AC | 167 ms
108,500 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 | -- | - |
ソースコード
def f(A): a0=0 P=defaultdict(int) AA=defaultdict(int) for a in A: a0^=a for p,val in P.items(): AA[a0^p]+=val AA[a0^p]%=MOD P[a0]+=1 AA[a0]+=1 return AA from collections import defaultdict MOD=10**9+7 N,M,K=map(int, input().split()) A=list(map(int, input().split())) B=list(map(int, input().split())) A=f(A) B=f(B) cnt=0 for a,val_a in A.items(): for b,val_b in B.items(): if a^b==K: cnt+=val_a*val_b cnt%=MOD print(cnt)