結果
| 問題 | No.1597 Matrix Sort |
| コンテスト | |
| ユーザー |
brthyyjp
|
| 提出日時 | 2021-10-20 11:11:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 498 bytes |
| 記録 | |
| コンパイル時間 | 217 ms |
| コンパイル使用メモリ | 85,932 KB |
| 実行使用メモリ | 67,444 KB |
| 最終ジャッジ日時 | 2026-04-08 18:16:46 |
| 合計ジャッジ時間 | 2,599 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | RE * 3 |
| other | RE * 27 |
ソースコード
import numpy as np
n, k, p = map(int, input().split())
A = np.array(input().split(), np.int64)
B = np.array(input().split(), np.int64)
A = np.sort(A)
B = np.sort(B)
def is_ok(x):
cnt = 0
cnt += np.searchsorted(B, x-A, side='right').sum()
cnt += np.searchsorted(B, p+x-A, side='right').sum()
cnt -= np.searchsorted(B, p-A, side='left').sum()
return cnt >= k
ng = -1
ok = p
while ng+1 < ok:
c = (ng+ok)//2
if is_ok(c):
ok = c
else:
ng = c
print(ok)
brthyyjp