leetcode:1326. 灌溉花园的最少水龙头数目(dp,困难)

题目: 分析:直接把水龙头转化为区间,那么就是一道简答的区间问题。 要所有覆盖,那么显然要选择某一位置开头(或包含某一位置),而后能够向右达到的最大长度。 也就是一道穿着华丽外表的基础题。 代码: class Solution { public: struct node{ int x; int y; } nn[10005];
相关文章
相关标签/搜索