結果

問題 No.206 数の積集合を求めるクエリ
ユーザー tcltktcltk
提出日時 2021-01-15 02:17:48
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 916 bytes
コンパイル時間 211 ms
コンパイル使用メモリ 82,392 KB
実行使用メモリ 127,956 KB
最終ジャッジ日時 2024-05-03 19:06:40
合計ジャッジ時間 14,138 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
89,220 KB
testcase_01 AC 119 ms
89,136 KB
testcase_02 AC 122 ms
88,832 KB
testcase_03 AC 133 ms
88,576 KB
testcase_04 AC 128 ms
88,576 KB
testcase_05 AC 123 ms
88,824 KB
testcase_06 AC 141 ms
89,796 KB
testcase_07 AC 141 ms
89,984 KB
testcase_08 AC 139 ms
89,600 KB
testcase_09 AC 144 ms
89,856 KB
testcase_10 AC 123 ms
89,344 KB
testcase_11 AC 124 ms
89,216 KB
testcase_12 AC 203 ms
89,984 KB
testcase_13 AC 183 ms
89,728 KB
testcase_14 AC 165 ms
90,368 KB
testcase_15 AC 150 ms
89,728 KB
testcase_16 AC 133 ms
89,856 KB
testcase_17 AC 247 ms
120,476 KB
testcase_18 AC 213 ms
102,144 KB
testcase_19 AC 238 ms
116,480 KB
testcase_20 AC 154 ms
103,936 KB
testcase_21 AC 195 ms
106,752 KB
testcase_22 AC 210 ms
106,752 KB
testcase_23 AC 253 ms
118,272 KB
testcase_24 TLE -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

#region Header
#!/usr/bin/env python3
# from typing import *

import sys
import io
import math
import collections
import decimal
import itertools
from queue import PriorityQueue
import bisect
import heapq

def input():
    return sys.stdin.readline()[:-1]

sys.setrecursionlimit(1000000)
#endregion

# _INPUT = """# paste here...
# """
# sys.stdin = io.StringIO(_INPUT)


def main():
    L, M, N = map(int, input().split())
    A = sorted(list(map(int, input().split())))
    B = sorted(list(map(int, input().split())))
    Q = int(input())

    T = [0 for _ in range(Q)]
    for j in range(M):
        b = B[j]
        k1 = bisect.bisect_left(A, b)
        if k1 == L:
            continue
        k2 = bisect.bisect_right(A, b+(Q-1))
        for k in range(k1, k2):
            a = A[k]
            i = a - b
            T[i] += 1
    for i in range(Q):
        print(T[i])


if __name__ == '__main__':
    main()
0