結果
| 問題 | No.1597 Matrix Sort |
| コンテスト | |
| ユーザー |
mrng
|
| 提出日時 | 2021-12-14 00:05:23 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
TLE
不安定
|
| 実行時間 | - |
| コード長 | 542 bytes |
| 記録 | |
| コンパイル時間 | 255 ms |
| コンパイル使用メモリ | 96,228 KB |
| 実行使用メモリ | 113,408 KB |
| 最終ジャッジ日時 | 2026-08-23 15:21:40 |
| 合計ジャッジ時間 | 29,827 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 TLE * 5 |
ソースコード
def lower_bound(a,x): ng,ok = -1,len(a) while ok-ng>1: m = (ng+ok)//2 if x<=a[m]: ok = m else: ng = m return ok def upper_bound(a,x): ok,ng = -1,len(a) while ng-ok>1: m = (ng+ok)//2 if x>a[m]: ok = m else: ng = m return ok n,k,p = map(int,input().split()) a = list(map(int,input().split())) b = list(map(int,input().split())) b.sort() l,r = -1,p while r-l>1: m = (l+r)//2 cnt = 0 for i in range(n): cnt += upper_bound(b,m+p-a[i])-lower_bound(b,p-a[i])+1+upper_bound(b,m-a[i])+1 if cnt<k: l = m else: r = m print(l)
mrng