热门标签
更多>
搜索结果
查询Tags标签: 喂饱,共有 2条记录-
贪?算法(leetcode-455):分发饼?
两个思路: 1、优先考虑饼干,小饼干先喂饱小胃口 2、优先考虑胃口,先喂饱大胃口 //方法一 优先考虑饼干,小饼干先喂饱小胃口 class Solution {public int findContentChildren(int[] g, int[] s) {Arrays.sort(g);Arrays.sort(s);int index = 0;//小饼干先喂饱…
2021/10/18 1:09:48 人评论 次浏览 -
贪?算法(leetcode-455):分发饼?
两个思路: 1、优先考虑饼干,小饼干先喂饱小胃口 2、优先考虑胃口,先喂饱大胃口 //方法一 优先考虑饼干,小饼干先喂饱小胃口 class Solution {public int findContentChildren(int[] g, int[] s) {Arrays.sort(g);Arrays.sort(s);int index = 0;//小饼干先喂饱…
2021/10/18 1:09:48 人评论 次浏览