这题我用贪心通过后.查看ANALYSIS,内容如下:
If we can purchase M boards, then we can leave unblocked M-1 runs of stalls without cows in them, in addition to any stalls on the leftmost side that don't have cows and any stalls on the rightmost side that don't have cows.
We input the list of cows in stalls, storing into an array whether or not there is a cow in a particular stall. Then we walk the array counting sizes of runs of cowless stalls. We sort the list of sizes and pick the M-1 largest ones as the stalls that will remain uncovered.
看不懂,估计是我的英文不好.请哪位英文强的同志,帮忙解释一下.在下将感激不尽.[p:4]