Problem Description
Loading...
Problem Analysis
Application of the binary search idea
Approaching continuously by bisecting from the maximum value down to 0
to find the maximum possible value
Unlike binary search for a particular number in an array
there is no need to sort the array here
because what is checked is how many pieces can be divided at the current mid
if too few pieces are made, it means the value needs to be smaller
otherwise it means it can be a little larger
repeating this way continuously approaches the correct result
The other thing to pay attention to is
data precision issues
cpp
| |
Problem links: 【POJ】[3122]Pie 【HDU】[1969]Pie