結果

問題 No.206 数の積集合を求めるクエリ
ユーザー rpy3cpp
提出日時 2015-05-09 00:42:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
TLE  
実行時間 -
コード長 612 bytes
コンパイル時間 102 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 30,288 KB
最終ジャッジ日時 2024-07-05 20:53:51
合計ジャッジ時間 10,841 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 14 TLE * 1 -- * 13
権限があれば一括ダウンロードができます

ソースコード

diff #

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

def solve(L, M, N, A, B, Q):
    A.sort()
    B.sort()
    counter = [0] * Q
    for bi in B:
        for ai in A:
            dif = ai - bi
            if dif < 0:
                continue
            if dif >= Q:
                break
            counter[dif] += 1
    return counter

if __name__ == '__main__':
    L, M, N, A, B, Q = read_data()
    counter = solve(L, M, N, A, B, Q)
    for c in counter:
        print(c)
0