結果
問題 |
No.1597 Matrix Sort
|
ユーザー |
![]() |
提出日時 | 2021-07-09 21:59:49 |
言語 | PyPy3 (7.3.15) |
結果 |
TLE
|
実行時間 | - |
コード長 | 421 bytes |
コンパイル時間 | 166 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 101,632 KB |
最終ジャッジ日時 | 2024-07-01 16:21:07 |
合計ジャッジ時間 | 13,230 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | -- * 3 |
other | AC * 3 TLE * 5 -- * 19 |
ソースコード
from bisect import* n, k, p = map(int, input().split()) A = tuple(map(int, input().split())) B = sorted(map(int, input().split())) def test(x): cnt = 0 for a in A: cnt += bisect_right(B, x-a) cnt += bisect_right(B, p+x-a) - bisect_right(B, p-a-1) return cnt >= k ok = p ng = -1 while ok - ng > 1: mid = (ok + ng) // 2 if test(mid): ok = mid else: ng = mid print(ok)