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

自己的网站如何做分销怎么做水果网站

自己的网站如何做分销,怎么做水果网站,wordpress 首页展示,专业做网站排名多少钱前言 思路及算法思维#xff0c;指路 代码随想录。 题目来自 LeetCode。 day26#xff0c; 休息的周末~ day 27#xff0c;周一#xff0c;库存没了#xff0c;哭死~ 题目详情 [39] 组合总和 题目描述 39 组合总和 解题思路 前提#xff1a;组合的子集问题…前言 思路及算法思维指路 代码随想录。 题目来自 LeetCode。 day26 休息的周末~ day 27周一库存没了哭死~ 题目详情 [39] 组合总和 题目描述 39 组合总和 解题思路 前提组合的子集问题统一元素可以重复选取 思路回溯 剪枝。 重点剪枝的前提是数组已排序。 代码实现 C语言 回溯 未排序剪枝 /*** Return an array of arrays of size *returnSize.* The sizes of the arrays are returned as *returnColumnSizes array.* Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().*/void backtracing(int* candidates, int candidatesSize, int target, int index, int *nums, int numsSize, int ***ans, int* returnSize, int** returnColumnSizes) {// 退出条件if (0 target){*ans (int **)realloc(*ans, sizeof(int *) * ((*returnSize) 1));(*ans)[*returnSize] (int *)malloc(sizeof(int) * (numsSize));for (int i 0; i numsSize; i){(*ans)[*returnSize][i] nums[i];}*returnColumnSizes (int *)realloc(*returnColumnSizes, sizeof(int) * ((*returnSize) 1));(*returnColumnSizes)[*returnSize] numsSize;(*returnSize);return ;}for (int j index; j candidatesSize; j){if (target candidates[j]){continue ;}// 递归nums[numsSize] candidates[j];numsSize;backtracing(candidates, candidatesSize, target - candidates[j], j, nums, numsSize, ans, returnSize, returnColumnSizes);// 回溯numsSize--;nums[numsSize] 0;}return ; }int** combinationSum(int* candidates, int candidatesSize, int target, int* returnSize, int** returnColumnSizes) {// 判空if (candidatesSize 0){return NULL;}// 输出int **ans NULL;int nums[41];int index 0;*returnSize 0;printf(%d\n, target);backtracing(candidates, candidatesSize, target, 0, nums, 0, ans, returnSize, returnColumnSizes);if (*returnSize 0){return NULL;}return ans; }回溯 排序 剪枝 /*** Return an array of arrays of size *returnSize.* The sizes of the arrays are returned as *returnColumnSizes array.* Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().*/int cmp(const void *p1, const void *p2) {return *(int *)p1 *(int *)p2; }void backtracing(int* candidates, int candidatesSize, int target, int index, int *nums, int numsSize, int ***ans, int* returnSize, int** returnColumnSizes) {// 退出条件if (0 target){*ans (int **)realloc(*ans, sizeof(int *) * ((*returnSize) 1));(*ans)[*returnSize] (int *)malloc(sizeof(int) * (numsSize));for (int i 0; i numsSize; i){(*ans)[*returnSize][i] nums[i];}*returnColumnSizes (int *)realloc(*returnColumnSizes, sizeof(int) * ((*returnSize) 1));(*returnColumnSizes)[*returnSize] numsSize;(*returnSize);return ;}// 剪枝for (int j index; (j candidatesSize) (target candidates[j]); j){// 递归nums[numsSize] candidates[j];numsSize;backtracing(candidates, candidatesSize, target - candidates[j], j, nums, numsSize, ans, returnSize, returnColumnSizes);// 回溯numsSize--;nums[numsSize] 0;}return ; }int** combinationSum(int* candidates, int candidatesSize, int target, int* returnSize, int** returnColumnSizes) {// 判空if (candidatesSize 0){return NULL;}// 排序qsort(candidates, candidatesSize, sizeof(int), cmp);// 输出int **ans NULL;int nums[41];int index 0;*returnSize 0;backtracing(candidates, candidatesSize, target, 0, nums, 0, ans, returnSize, returnColumnSizes);if (*returnSize 0){return NULL;}return ans; }[40] 组合总和II 题目描述 40 组合总和II 解题思路 前提组合的子集问题同一元素只能使用一次但是结果不包含重复组合 思路回溯 剪枝 重点结果子集中排除重复组合需要树形结构中同一树层的相同的元素值不可重复选取使用used数组实现去重。 代码实现 C语言 利用used数组 false同一树层 去重 /*** Return an array of arrays of size *returnSize.* The sizes of the arrays are returned as *returnColumnSizes array.* Note: Both returned array and *columnSizes array must be malloced, assume caller calls free().*/int cmp(const void *p1, const void *p2) {return *(int *)p1 *(int *)p2; }void backtracing(int* candidates, int candidatesSize, int target, int index, int *nums, int numsSize, bool *used, int ***ans, int* returnSize, int** returnColumnSizes) {// 退出条件if (0 target){*ans (int **)realloc(*ans, sizeof(int *) * ((*returnSize) 1));(*ans)[*returnSize] (int *)malloc(sizeof(int) * (numsSize));for (int i 0; i numsSize; i){(*ans)[*returnSize][i] nums[i];}*returnColumnSizes (int *)realloc(*returnColumnSizes, sizeof(int) * ((*returnSize) 1));(*returnColumnSizes)[*returnSize] numsSize;(*returnSize);return ;}for (int j index; (j candidatesSize) (target candidates[j]); j){// 去重if ((j 0) (candidates[j] candidates[j - 1]) (used[j - 1] false)){continue;}// 递归nums[numsSize] candidates[j];used[j] true;numsSize;backtracing(candidates, candidatesSize, target - candidates[j], j 1, nums, numsSize, used, ans, returnSize, returnColumnSizes);// 回溯numsSize--;used[j] false;nums[numsSize] 0;}return ; }int** combinationSum2(int* candidates, int candidatesSize, int target, int* returnSize, int** returnColumnSizes) {// 判空if (candidatesSize 0){return NULL;}// 排序qsort(candidates, candidatesSize, sizeof(int), cmp);// 输出int **ans NULL;int nums[100] {0};bool used[100] {false};int index 0;*returnSize 0;backtracing(candidates, candidatesSize, target, 0, nums, 0, used, ans, returnSize, returnColumnSizes);if (*returnSize 0){return NULL;}return ans; }[131] 分割回文串 题目描述 131 分割回文串 解题思路 前提分割问题 思路。 重点。 代码实现 C语言 // 待补充今日收获 组合子集问题去重同一树层去重 vs 同一树杈去重切割问题。
文章转载自:
http://www.morning.mingjiangds.com.gov.cn.mingjiangds.com
http://www.morning.qbwyd.cn.gov.cn.qbwyd.cn
http://www.morning.jfwbr.cn.gov.cn.jfwbr.cn
http://www.morning.lyldhg.cn.gov.cn.lyldhg.cn
http://www.morning.qkkmd.cn.gov.cn.qkkmd.cn
http://www.morning.wttzp.cn.gov.cn.wttzp.cn
http://www.morning.wqbhx.cn.gov.cn.wqbhx.cn
http://www.morning.hjrjr.cn.gov.cn.hjrjr.cn
http://www.morning.cdlewan.com.gov.cn.cdlewan.com
http://www.morning.qxdrw.cn.gov.cn.qxdrw.cn
http://www.morning.hghhy.cn.gov.cn.hghhy.cn
http://www.morning.brsgw.cn.gov.cn.brsgw.cn
http://www.morning.yqsq.cn.gov.cn.yqsq.cn
http://www.morning.hmpxn.cn.gov.cn.hmpxn.cn
http://www.morning.tmbfz.cn.gov.cn.tmbfz.cn
http://www.morning.pcngq.cn.gov.cn.pcngq.cn
http://www.morning.yrccw.cn.gov.cn.yrccw.cn
http://www.morning.kcnjz.cn.gov.cn.kcnjz.cn
http://www.morning.qckwj.cn.gov.cn.qckwj.cn
http://www.morning.fbrshjf.com.gov.cn.fbrshjf.com
http://www.morning.nqmkr.cn.gov.cn.nqmkr.cn
http://www.morning.fgqbx.cn.gov.cn.fgqbx.cn
http://www.morning.xxiobql.cn.gov.cn.xxiobql.cn
http://www.morning.cnvlog.cn.gov.cn.cnvlog.cn
http://www.morning.ydzly.cn.gov.cn.ydzly.cn
http://www.morning.nrfqd.cn.gov.cn.nrfqd.cn
http://www.morning.fdmfn.cn.gov.cn.fdmfn.cn
http://www.morning.spghj.cn.gov.cn.spghj.cn
http://www.morning.sdamsm.com.gov.cn.sdamsm.com
http://www.morning.dbdmr.cn.gov.cn.dbdmr.cn
http://www.morning.ypklb.cn.gov.cn.ypklb.cn
http://www.morning.hhqjf.cn.gov.cn.hhqjf.cn
http://www.morning.llcgz.cn.gov.cn.llcgz.cn
http://www.morning.knswz.cn.gov.cn.knswz.cn
http://www.morning.nrzbq.cn.gov.cn.nrzbq.cn
http://www.morning.fpryg.cn.gov.cn.fpryg.cn
http://www.morning.zrks.cn.gov.cn.zrks.cn
http://www.morning.sfwcb.cn.gov.cn.sfwcb.cn
http://www.morning.yrbp.cn.gov.cn.yrbp.cn
http://www.morning.ydnxm.cn.gov.cn.ydnxm.cn
http://www.morning.zhiheliuxue.com.gov.cn.zhiheliuxue.com
http://www.morning.plydc.cn.gov.cn.plydc.cn
http://www.morning.gmyhq.cn.gov.cn.gmyhq.cn
http://www.morning.lbcfj.cn.gov.cn.lbcfj.cn
http://www.morning.xckdn.cn.gov.cn.xckdn.cn
http://www.morning.dmjhp.cn.gov.cn.dmjhp.cn
http://www.morning.wflpj.cn.gov.cn.wflpj.cn
http://www.morning.drmbh.cn.gov.cn.drmbh.cn
http://www.morning.fhhry.cn.gov.cn.fhhry.cn
http://www.morning.snkry.cn.gov.cn.snkry.cn
http://www.morning.4r5w91.cn.gov.cn.4r5w91.cn
http://www.morning.grbp.cn.gov.cn.grbp.cn
http://www.morning.tyhfz.cn.gov.cn.tyhfz.cn
http://www.morning.dpjtn.cn.gov.cn.dpjtn.cn
http://www.morning.c7627.cn.gov.cn.c7627.cn
http://www.morning.hxfrd.cn.gov.cn.hxfrd.cn
http://www.morning.mqbsm.cn.gov.cn.mqbsm.cn
http://www.morning.fhntj.cn.gov.cn.fhntj.cn
http://www.morning.tfznk.cn.gov.cn.tfznk.cn
http://www.morning.xscpq.cn.gov.cn.xscpq.cn
http://www.morning.trjr.cn.gov.cn.trjr.cn
http://www.morning.nkjkh.cn.gov.cn.nkjkh.cn
http://www.morning.rnnq.cn.gov.cn.rnnq.cn
http://www.morning.wypyl.cn.gov.cn.wypyl.cn
http://www.morning.rxsgk.cn.gov.cn.rxsgk.cn
http://www.morning.yfmwg.cn.gov.cn.yfmwg.cn
http://www.morning.mbpfk.cn.gov.cn.mbpfk.cn
http://www.morning.dmrjx.cn.gov.cn.dmrjx.cn
http://www.morning.tqwcm.cn.gov.cn.tqwcm.cn
http://www.morning.stph.cn.gov.cn.stph.cn
http://www.morning.dnqpq.cn.gov.cn.dnqpq.cn
http://www.morning.xpmwt.cn.gov.cn.xpmwt.cn
http://www.morning.sjbpg.cn.gov.cn.sjbpg.cn
http://www.morning.qtkfp.cn.gov.cn.qtkfp.cn
http://www.morning.tygn.cn.gov.cn.tygn.cn
http://www.morning.ykrkq.cn.gov.cn.ykrkq.cn
http://www.morning.qrwjb.cn.gov.cn.qrwjb.cn
http://www.morning.nyzmm.cn.gov.cn.nyzmm.cn
http://www.morning.pnmtk.cn.gov.cn.pnmtk.cn
http://www.morning.mrtdq.cn.gov.cn.mrtdq.cn
http://www.tj-hxxt.cn/news/235936.html

相关文章:

  • 个人网站收款wordpress 答题主题
  • 网站建设新闻发布注意网站设计工程师
  • 营销型外贸网站建设软件做网站的软件有哪些
  • 门户网站的盈利模式做外贸在那些网站找客户
  • 网站制作网站建设项目规划书全媒体网站的建设方案
  • 制作网站登录性做网站
  • 人人开发网站wordpress按照证书
  • 无锡网站制作那些做服装有哪些好的网站有哪些
  • 广西网站建设公司招聘做的网站怎么放到域名
  • 绵竹网站制作中国建筑设计网站
  • 嘉兴公司做网站做直播网站软件有哪些
  • 四川省住房和城乡建设厅网站域名家具网站建设便宜
  • 寿县网站建设线上美工招聘
  • eclipse可以做网站嘛网站 文件夹 上传
  • 四川建设厅网站施工员证查询wordpress更改主题首页
  • 培训网站图片比较好的设计公司
  • 电子商务网站建设的流程图万网域名解析平台
  • 网站搜索排名高怎么做网站网页设计尺寸
  • 挂别人公司做网站可以吗wordpress怎么改登陆不了
  • 长兴网站建设列举企业网站建设有哪些好处360网站空间
  • 腾讯云备案网站建设方案书广州公布一批重点场所
  • 云浮网站建设安徽省建设法制协会网站
  • 沈阳做网站的公司排行对电子商务网站与建设的心得
  • 电子商务网站开发背景与原因站长工具源码
  • 17一起广州做网站石家庄信息门户网站制作费用
  • 松江专业做网站建设企业银行
  • .net和php那个做网站好抚州市住房和城乡建设局网站
  • 网站建设如何上传文件网站设计制作费用多少
  • 学校网站建设管理制度卡盟网站顶图怎么做
  • 网站建设需要知道什么wordpress站点添加skype