pub fn bsearch_ng_ok<T: Copy + PartialOrd + Add<Output = T> + Sub<Output = T> + Div<Output = T> + From<u8>>(
lower: T,
upper: T,
f: impl Fn(T) -> bool,
) -> SearchResult<T>Expand description
二分探索
fは、lower..=upperの範囲で、ある値を境界にそれ未満では常にfalse、それ以上では常にtrueとなる関数
Time complexity $O(\log n)$