ABC212 C問題
https://scrapbox.io/files/611783f0137a2d001d84ef82.png
code:swift
let input = readLine()!.split(separator: " ").map{Int($0)!}
var A = readLine()!.split(separator: " ").map{Int($0)!}
var B = readLine()!.split(separator: " ").map{Int($0)!}
A = A.sorted()
B = B.sorted()
var ans = 10000000000
func binary_search(key:Int) -> Int{
var left = -1
var right = A.count-1
while (right - left > 1){
let mid = left + (right - left)/2
right = mid
}else{
left = mid
}
}
return right
}
var key_right:Int
var key_left:Int
for i in 0..<B.count{
key_right = binary_search(key: Bi) if key_right < A.count{
}
if key_right > 0{
key_left = key_right - 1
}
}
}
}
print(ans)