結果

問題 No.206 数の積集合を求めるクエリ
ユーザー rpy3cpprpy3cpp
提出日時 2015-05-09 00:42:39
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 612 bytes
コンパイル時間 319 ms
コンパイル使用メモリ 10,836 KB
実行使用メモリ 27,740 KB
最終ジャッジ日時 2023-09-19 09:08:48
合計ジャッジ時間 11,116 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,972 KB
testcase_01 AC 16 ms
7,816 KB
testcase_02 AC 16 ms
7,812 KB
testcase_03 AC 16 ms
7,776 KB
testcase_04 AC 16 ms
7,760 KB
testcase_05 AC 16 ms
7,828 KB
testcase_06 AC 53 ms
8,492 KB
testcase_07 AC 68 ms
8,528 KB
testcase_08 AC 97 ms
8,336 KB
testcase_09 AC 92 ms
8,560 KB
testcase_10 AC 16 ms
7,896 KB
testcase_11 AC 16 ms
7,876 KB
testcase_12 AC 665 ms
8,460 KB
testcase_13 AC 352 ms
8,576 KB
testcase_14 AC 242 ms
8,656 KB
testcase_15 AC 20 ms
8,664 KB
testcase_16 AC 19 ms
8,568 KB
testcase_17 TLE -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
権限があれば一括ダウンロードができます

ソースコード

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