Problem Description
Loading...
Problem Analysis
It is also a problem of **optimizing the extrem*e value
Once you master the technique, this kind of problem is still quite simple
The idea is always to use binary search to find the answer
then check whether this answer meets the requirement
this way you can keep bisecting
to shrink the interval containing the answer
The way this problem checks whether an answer is valid
if the minimum value is x
then for the answer to hold
some rocks need to be removed
obviously
if you want the answer to satisfy the condition
the number of rocks to remove must satisfy cnt<=m
Through binary search
you can find the one that makes the answer valid
the largest res
cpp
| |
Problem link: 【POJ】[3258]River Hopscotch