結果

問題 No.1597 Matrix Sort
ユーザー rlangevinrlangevin
提出日時 2023-06-29 12:30:30
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 444 bytes
コンパイル時間 267 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 103,152 KB
最終ジャッジ日時 2023-09-20 07:56:41
合計ジャッジ時間 15,174 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
75,592 KB
testcase_01 AC 79 ms
75,480 KB
testcase_02 AC 79 ms
75,372 KB
testcase_03 TLE -
testcase_04 TLE -
testcase_05 TLE -
testcase_06 TLE -
testcase_07 TLE -
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 *

N, K, P = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
B.sort()
no = -1
yes = P

def check(m):
    cnt = 0
    for a in A:
        cnt += bisect_right(B, m - a)
        cnt += bisect_right(B, P + m - a) - bisect_left(B, P - a)
    return cnt >= K


while yes - no != 1:
    mid = (yes + no)//2
    if check(mid):
        yes = mid
    else:
        no = mid
print(yes) 
0