結果
| 問題 | 
                            No.206 数の積集合を求めるクエリ
                             | 
                    
| コンテスト | |
| ユーザー | 
                             ntuda
                         | 
                    
| 提出日時 | 2025-01-28 22:16:51 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 600 bytes | 
| コンパイル時間 | 1,791 ms | 
| コンパイル使用メモリ | 81,784 KB | 
| 実行使用メモリ | 174,036 KB | 
| 最終ジャッジ日時 | 2025-01-28 22:17:47 | 
| 合計ジャッジ時間 | 49,200 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 26 TLE * 2 | 
ソースコード
L,M,N = map(int,input().split())
A = list(map(int,input().split()))
B = list(map(int,input().split()))
n = N//30 + 1
A2 = [0] * (n)
B2 = [0] * (n)
of = 1 << 30
for a in A:
    x = a // 30
    y = a % 30
    A2[x] ^= (1 << y)
for b in B:
    x = b // 30
    y = b % 30
    B2[x] ^= (1 << y)
for i in range(int(input())):
    ans = 0
    for j in range(n):
        ans += (A2[j] & B2[j]).bit_count()
    print(ans)
    carry = 0
    for i in range(n):
        B2[i] <<= 1
        B2[i] |= carry
        if B2[i] & of:
            carry = 1
            B2[i] ^= of
        else:
            carry = 0
            
            
            
        
            
ntuda