結果
| 問題 |
No.1597 Matrix Sort
|
| コンテスト | |
| ユーザー |
回転
|
| 提出日時 | 2025-11-14 03:26:31 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
TLE
|
| 実行時間 | - |
| コード長 | 526 bytes |
| コンパイル時間 | 295 ms |
| コンパイル使用メモリ | 82,396 KB |
| 実行使用メモリ | 104,296 KB |
| 最終ジャッジ日時 | 2025-11-14 03:27:12 |
| 合計ジャッジ時間 | 37,598 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 TLE * 17 |
ソースコード
import bisect
N,K,P = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
A.sort()
B.sort()
def check(n):
count = 0
for i in A:
left = bisect.bisect_left(B, P-i)
right = bisect.bisect_right(B, n+P-i)
count += right - left
right2 = bisect.bisect_right(B, n-i)
count += right2
return count >= K
ng,ok = -1,P-1
while(ok - ng > 1):
mid = (ok+ng)//2
if(check(mid)):
ok = mid
else:
ng = mid
print(ok)
回転