What good method can be well understood this boundary? Or is there a better template
I use the template is like this:
Max:
void of solve () {
Int l=0, r=MAXN;
for(int i=0; i<100; I++) {
Int mid=(r + l + 1)/2;//this place what determine
If (check (mid)) {
L=mid;
} else {
R=mid - 1;
}
}
Cout}
A minimum value:
void of solve () {
Int lb=0, rb=maxn;
for(int i=0; i<100; I++) {
Int mid=(lb + rb + 1)/2;//this place what determine
If (check (mid)) {
Rb=mid;
} else {
Lb=mid + 1;
}
}
Cout
}