結果
| 問題 | No.206 数の積集合を求めるクエリ |
| コンテスト | |
| ユーザー |
lam6er
|
| 提出日時 | 2025-04-09 21:05:09 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 639 bytes |
| 記録 | |
| コンパイル時間 | 231 ms |
| コンパイル使用メモリ | 95,084 KB |
| 実行使用メモリ | 290,176 KB |
| 最終ジャッジ日時 | 2026-07-08 15:05:25 |
| 合計ジャッジ時間 | 13,042 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 TLE * 1 -- * 6 |
ソースコード
import bisect
def main():
import sys
input = sys.stdin.read().split()
ptr = 0
L, M, N = map(int, input[ptr:ptr+3])
ptr +=3
A = list(map(int, input[ptr:ptr+L]))
ptr += L
B = list(map(int, input[ptr:ptr+M]))
ptr += M
Q = int(input[ptr])
ptr +=1
A.sort()
counter = [0] * Q
for b in B:
lower = b
upper = b + Q - 1
left = bisect.bisect_left(A, lower)
right = bisect.bisect_right(A, upper)
for a in A[left:right]:
v = a - b
counter[v] += 1
for cnt in counter:
print(cnt)
if __name__ == "__main__":
main()
lam6er