結果

問題 No.206 数の積集合を求めるクエリ
ユーザー mkawa2mkawa2
提出日時 2020-01-28 09:47:02
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 323 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,680 KB
実行使用メモリ 23,576 KB
最終ジャッジ日時 2023-10-13 09:20:56
合計ジャッジ時間 12,296 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,948 KB
testcase_01 AC 16 ms
7,764 KB
testcase_02 AC 16 ms
7,936 KB
testcase_03 AC 16 ms
7,804 KB
testcase_04 AC 15 ms
7,764 KB
testcase_05 AC 16 ms
7,928 KB
testcase_06 AC 17 ms
8,192 KB
testcase_07 AC 17 ms
8,200 KB
testcase_08 AC 17 ms
8,568 KB
testcase_09 AC 17 ms
8,332 KB
testcase_10 AC 16 ms
7,800 KB
testcase_11 AC 16 ms
7,848 KB
testcase_12 AC 45 ms
8,572 KB
testcase_13 AC 37 ms
8,472 KB
testcase_14 AC 27 ms
8,540 KB
testcase_15 AC 31 ms
8,576 KB
testcase_16 AC 27 ms
8,532 KB
testcase_17 AC 277 ms
23,576 KB
testcase_18 AC 147 ms
15,612 KB
testcase_19 AC 253 ms
21,552 KB
testcase_20 AC 149 ms
19,588 KB
testcase_21 AC 188 ms
16,960 KB
testcase_22 AC 143 ms
19,136 KB
testcase_23 AC 259 ms
22,608 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def tobit(aa):
    res = 0
    for a in aa: res |= 1 << a
    return res

def popcnt(a): return bin(a).count("1")

l, m, n = map(int, input().split())
aa = list(map(int, input().split()))
bb = list(map(int, input().split()))
a = tobit(aa)
b = tobit(bb)
q = int(input())
for _ in range(q):
    print(popcnt(a & b))
    b<<=1
0