def binary_search(lst, target):
if len(lst) == 0:
return None
low, high = 0, len(lst)-1
while low < high:
mid = (low + high + 1) // 2 # 向上取整
if lst[mid] <= target:
low = mid
else:
high = mid - 1
return low if lst[low] == target else None