Can you explain why the BSBV template in your other video doesn't work here? How to choose using l or r as base for BSBV? Thank you so much for the excellent lecture! (I can read Chinese, just don't have Pinying input lol. XieXie!!) l, r = 1, max(ribbons) while l < r: mid = r - (r - l) // 2 if is_ok(mid): l = mid else: r = mid - 1
Learned so much about binary search by value from your vids. Thanks!
Can you explain why the BSBV template in your other video doesn't work here? How to choose using l or r as base for BSBV? Thank you so much for the excellent lecture! (I can read Chinese, just don't have Pinying input lol. XieXie!!)
l, r = 1, max(ribbons)
while l < r:
mid = r - (r - l) // 2
if is_ok(mid):
l = mid
else:
r = mid - 1
这个模板本身没有问题。但是你的is_OK(mid)是在这里是什么意思呢?