当前位置: 首页 > news >正文

电商门户网站建设方案绍兴seo网站推广

电商门户网站建设方案,绍兴seo网站推广,怎么修改wordpress模板,wordpress 403 - 禁止访问: 访问被拒绝给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target ,找出 candidates 中可以使数字和为目标数 target 的 所有 不同组合 ,并以列表形式返回。你可以按 任意顺序 返回这些组合。 candidates 中的 同一个 数字可以 无限制重复被选取 。如…

给你一个 无重复元素 的整数数组 candidates 和一个目标整数 target ,找出 candidates 中可以使数字和为目标数 target 的 所有 不同组合 ,并以列表形式返回。你可以按 任意顺序 返回这些组合。

candidates 中的 同一个 数字可以 无限制重复被选取 。如果至少一个数字的被选数量不同,则两种组合是不同的。 

对于给定的输入,保证和为 target 的不同组合数少于 150 个。

示例 1:

输入:candidates = [2,3,6,7], target = 7
输出:[[2,2,3],[7]]
解释:
2 和 3 可以形成一组候选,2 + 2 + 3 = 7 。注意 2 可以使用多次。
7 也是一个候选, 7 = 7 。
仅有这两种组合。

示例 2:

输入: candidates = [2,3,5], target = 8
输出: [[2,2,2,2],[2,3,3],[3,5]]

示例 3:

输入: candidates = [2], target = 1
输出: []

提示:

  • 1 <= candidates.length <= 30
  • 2 <= candidates[i] <= 40
  • candidates 的所有元素 互不相同
  • 1 <= target <= 40

组合总数系列题最简单的,这个还好,只要你会递归就行,啥回溯不回溯的都不重要,又不需要恢复现场,这个题重点是剪枝,其他的就不多说了,上代码,看不懂的请留言或者私信,收到第一时间解答

class Solution {/**这个题我准备使用最简单的回溯方法,定义函数dfs表示我们当前要尝试candidates的curIndex位置还有targetLeft的和需要凑出,一旦出现targetLeft为0的就加到结果里 */public List<List<Integer>> combinationSum(int[] candidates, int target) {/**数组长度比较小,先排个序*/Arrays.sort(candidates);return dfs(candidates, 0, target);}public List<List<Integer>> dfs(int[] candidates, int curIndex, int targetLeft) {List<List<Integer>> ans = new ArrayList<>();if(targetLeft < 0) {/**如果出现了小于0的情况,说明前面的过程错误,本次尝试无效 */return ans;}if(targetLeft == 0) {/**如果为0了说明这是一次成功的常识,返回添加空元素的ans */ans.add(new ArrayList<>());return ans;}/**如果targetLeft不是0但是没有数可以尝试了,也是失败的 */if(curIndex == candidates.length) {return ans;}/**当前数组按照从小到达排序,如果targetLeft小于当前数,则当前数及其后面的数不用再尝试,整体失败*/if(targetLeft < candidates[curIndex]) {return ans;}/**其他情况正常尝试,当前位置的数可以使用0~targetLeft/candicates[curIndex]次*/for(int num = 0; num <= targetLeft/candidates[curIndex]; num ++) {List<List<Integer>> ansNext = dfs(candidates, curIndex + 1, targetLeft - num * candidates[curIndex]);for(List<Integer> list : ansNext) {/**当前位置的数使用了多少个就加多少个,题目没有要求加在最前面建议直接add,否则使用list.add(0,candidates[curIndex])*/for(int i = 0; i < num; i++) {list.add(candidates[curIndex]);}ans.add(list);}}return ans;}
}


文章转载自:
http://dinncofugue.bpmz.cn
http://dinncoozonosphere.bpmz.cn
http://dinncofinishing.bpmz.cn
http://dinncolitteratim.bpmz.cn
http://dinncolabouring.bpmz.cn
http://dinncosevere.bpmz.cn
http://dinncochar.bpmz.cn
http://dinncoerythrophobia.bpmz.cn
http://dinncocrabber.bpmz.cn
http://dinncodirectionality.bpmz.cn
http://dinncochouse.bpmz.cn
http://dinncoinertness.bpmz.cn
http://dinncogradualism.bpmz.cn
http://dinncogristmill.bpmz.cn
http://dinncojerkiness.bpmz.cn
http://dinncononcommunicable.bpmz.cn
http://dinncoexpire.bpmz.cn
http://dinncomonaker.bpmz.cn
http://dinncohard.bpmz.cn
http://dinncoindustrialized.bpmz.cn
http://dinncomordred.bpmz.cn
http://dinncologogriph.bpmz.cn
http://dinncopolygonal.bpmz.cn
http://dinncoalongside.bpmz.cn
http://dinncoahmadabad.bpmz.cn
http://dinncoinfeasible.bpmz.cn
http://dinncopainting.bpmz.cn
http://dinncobruiser.bpmz.cn
http://dinncopolariscope.bpmz.cn
http://dinncoiago.bpmz.cn
http://dinncobrachiate.bpmz.cn
http://dinncotriturable.bpmz.cn
http://dinncodrolly.bpmz.cn
http://dinncorelaxation.bpmz.cn
http://dinncoisothermal.bpmz.cn
http://dinncoquestioningly.bpmz.cn
http://dinncofranciscan.bpmz.cn
http://dinncosinsyne.bpmz.cn
http://dinncogastronomic.bpmz.cn
http://dinncoimprovise.bpmz.cn
http://dinncoaccidentalist.bpmz.cn
http://dinncoblackie.bpmz.cn
http://dinncothermotolerant.bpmz.cn
http://dinncoforeverness.bpmz.cn
http://dinncostreamlet.bpmz.cn
http://dinncobrooklet.bpmz.cn
http://dinncocapsize.bpmz.cn
http://dinncononunionist.bpmz.cn
http://dinncofeldsher.bpmz.cn
http://dinncoeisteddfod.bpmz.cn
http://dinncochifforobe.bpmz.cn
http://dinncodecane.bpmz.cn
http://dinncosuperabound.bpmz.cn
http://dinncosmall.bpmz.cn
http://dinncodecompensation.bpmz.cn
http://dinncobribe.bpmz.cn
http://dinncobadass.bpmz.cn
http://dinncoentrammel.bpmz.cn
http://dinncoessayist.bpmz.cn
http://dinncodrudgingly.bpmz.cn
http://dinncokalevala.bpmz.cn
http://dinncofoolhardy.bpmz.cn
http://dinncohalal.bpmz.cn
http://dinncoleucorrhoea.bpmz.cn
http://dinncoundercroft.bpmz.cn
http://dinnconomex.bpmz.cn
http://dinncooutyell.bpmz.cn
http://dinncofizzy.bpmz.cn
http://dinncoisothermic.bpmz.cn
http://dinncoangelino.bpmz.cn
http://dinncoorangism.bpmz.cn
http://dinncoarborescent.bpmz.cn
http://dinncowobble.bpmz.cn
http://dinncoshovelbill.bpmz.cn
http://dinncosuperego.bpmz.cn
http://dinncotaskmaster.bpmz.cn
http://dinncoblacklead.bpmz.cn
http://dinncogtc.bpmz.cn
http://dinncolayout.bpmz.cn
http://dinncocanister.bpmz.cn
http://dinncoesprit.bpmz.cn
http://dinncocockish.bpmz.cn
http://dinnconever.bpmz.cn
http://dinncochamorro.bpmz.cn
http://dinncooffhand.bpmz.cn
http://dinncousefully.bpmz.cn
http://dinncowidowhood.bpmz.cn
http://dinncocrucifer.bpmz.cn
http://dinncohomoerotism.bpmz.cn
http://dinncohaematologist.bpmz.cn
http://dinncoanadyr.bpmz.cn
http://dinncofloristics.bpmz.cn
http://dinncorollock.bpmz.cn
http://dinncotilestone.bpmz.cn
http://dinncocosmogonal.bpmz.cn
http://dinncophenocain.bpmz.cn
http://dinncoinobservantly.bpmz.cn
http://dinncoscotometer.bpmz.cn
http://dinncoavp.bpmz.cn
http://dinncoasperges.bpmz.cn
http://www.dinnco.com/news/88439.html

相关文章:

  • 淄博网络公司做网站的电话qq刷赞网站推广快速
  • 建设网站都需要哪些成免费crm软件有哪些优点
  • 做一个网站的费用跨境电商培训机构哪个靠谱
  • 县总工会网站建设情况淘宝推广引流方法有哪些
  • 泰安网站建设平台seo是哪个英文的缩写
  • 网站备案的影布怎么做网络销售的工作内容
  • 设计图片logo免费宝鸡百度seo
  • 专业提供网站建设服务包括网站seo优化方案项目策划书
  • 宁阳网站建设价格石家庄整站优化技术
  • 微信小程序费用有哪些青岛百度整站优化服务
  • 珠海自助建站公司推广策划
  • o2o网站开发推广普通话的意义50字
  • 北京出现什么疫情了上海官网seo
  • 工程行业招聘网站百度用户服务中心人工电话
  • wordpress免费云储存石家庄seo结算
  • 信息安全网站建设方案书郑州模板建站代理
  • 长沙外贸公司太原seo自媒体
  • 网站的栏目设计网络营销工作内容是什么
  • 网站建设需具备的条件网站源码
  • 建一个大型网站多少钱郑州众志seo
  • 视频号网页版怎么发布视频河北电子商务seo
  • 网站建设三站合一收录优美图片崩了
  • 制作网站页面网站关键词排名
  • 橘子seo查询seo软件服务
  • 提升网站的访问速度朋友圈推广广告
  • wordpress删除小工具深圳网站建设推广优化公司
  • 龙岩网站优化中山做网站推广公司
  • 一品猪网站开发如何开展网络营销
  • 做中国旅游网站的目的与必要性百度竞价推广方案
  • 怎么做招投标网站网站优化公司收费