while (l <= r)
{
mid = l + (r - l) >> 1;
......
}
这样是错误的! 由于>>的优先级问题,应用如下格式。
while (l <= r)
{
mid = l +( (r - l) >> 1);
......
}
标签:二分,易错,优先级,......,板子,while
From: https://www.cnblogs.com/kdlyh/p/17785721.html
while (l <= r)
{
mid = l + (r - l) >> 1;
......
}
while (l <= r)
{
mid = l +( (r - l) >> 1);
......
}
标签:二分,易错,优先级,......,板子,while
From: https://www.cnblogs.com/kdlyh/p/17785721.html