結果

問題 No.1597 Matrix Sort
ユーザー hir355hir355
提出日時 2021-07-09 22:02:19
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 412 bytes
コンパイル時間 262 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 103,528 KB
最終ジャッジ日時 2023-09-14 09:03:43
合計ジャッジ時間 3,961 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 76 ms
75,512 KB
testcase_02 AC 78 ms
75,460 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from bisect import bisect_right
n, k, p = map(int, input().split())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
a.sort()
b.sort()
l, r = -1, p - 1
for j in range(n):
    m = (l + r) // 2
    t = 0
    for i in range(n):
        t += bisect_right(b, p + m - a[i]) - bisect_right(b, p - 1 - a[i]) + bisect_right(b, m - a[i])
    if t >= k:
        r = m
    else:
        l = m
print(r)
0