結果
| 問題 | No.1597 Matrix Sort |
| コンテスト | |
| ユーザー |
rlangevin
|
| 提出日時 | 2023-06-29 12:30:30 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 269 ms |
| コンパイル使用メモリ | 85,280 KB |
| 実行使用メモリ | 110,076 KB |
| 最終ジャッジ日時 | 2026-03-27 14:16:01 |
| 合計ジャッジ時間 | 28,313 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 TLE * 4 |
ソースコード
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)
rlangevin