int bs(int n)
{
int l = -1, r = n;
while (l + 1 != r)
{
int m = l + r >> 1;
if (xx)
{
l = m;
}
else
{
r = m;
}
}
return l / r;
}
[模板]一种蛮新颖的二分写法
发布于 2021-10-25 1460 次阅读
发布于 2021-10-25 1460 次阅读
int bs(int n)
{
int l = -1, r = n;
while (l + 1 != r)
{
int m = l + r >> 1;
if (xx)
{
l = m;
}
else
{
r = m;
}
}
return l / r;
}
Comments | NOTHING