二分模板

· · 个人记录

while(l<=r)
{
    int mid=(l+r)>>1;
    if(check(mid)) ans=mid,l=mid+1; 
    else r=mid-1;
}