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

有人用公司名字做网站 怎么维权搜索引擎排名机制

有人用公司名字做网站 怎么维权,搜索引擎排名机制,大同网站设计,网站建设太金手指六六二七第一题: 原题链接:39. 组合总和 - 力扣(LeetCode) 思路: 终止条件: 用一个sum值来记录当前组合中元素的总和。当sum的值大于target的时候证明该组合不合适,直接return。当sum的值等于target的…

第一题:
原题链接:39. 组合总和 - 力扣(LeetCode)

思路:

终止条件:

用一个sum值来记录当前组合中元素的总和。当sum的值大于target的时候证明该组合不合适,直接return。当sum的值等于target的时候将组合添加到组合集合中。

for循环中注意本题中的元素是可以重复选取的,因此下层递归中的startIndex还是i。

剩下的就是回溯的模板。

代码如下:

class Solution {
public:vector<vector<int>> combinationSum(vector<int>& candidates, int target) {if(candidates.size() == 0) return {};backtracking(candidates, target, 0, 0);return res;}
private:vector<vector<int>> res;vector<int> path;void backtracking(vector<int>& candidates, int target, int sum, int startIndex){if(sum > target){return;}if(sum == target){res.push_back(path);return;}for(int i = startIndex; i < candidates.size(); i++){path.push_back(candidates[i]);sum += candidates[i];backtracking(candidates, target, sum, i);sum -= candidates[i];path.pop_back();}}
};

第二题:

原题链接:40. 组合总和 II - 力扣(LeetCode)

思路:

本题要注意的是去重的逻辑。

首先我们对数组进行排序,让相同的元素紧挨着。方便我们进行去重的逻辑。

Carl提到了树层和树枝去重的概念,这个概念很便于理解。本题要注意的就是树层去重的逻辑。树枝上不需要去重,因为树枝上的元素对应的是不同的元素。而树层上的元素必须要去重,因为在树枝上前一个相同的元素的遍历会包含当前元素的所有遍历结果,因此如果在同一层中当前的元素和前一个元素相同并且前一个元素没有被使用过的情况下,该元素直接跳过。

同时我们需要一个bool类型的数组来记得什么元素已经使用过了。当我们使用过的话将该数组对应的位置置为true;

代码如下:

class Solution {
public:vector<vector<int>> combinationSum2(vector<int>& candidates, int target) {sort(candidates.begin(), candidates.end());vector<bool> used(candidates.size(), false);backtracking(candidates, target, 0, 0, used);return res;}
private:vector<vector<int>> res;vector<int> path;void backtracking(vector<int>& candidates, int target, int sum, int startIndex, vector<bool>& used){if(sum > target)return;if(sum == target){res.push_back(path);return;}for(int i = startIndex; i < candidates.size(); i++){if(i > 0 && candidates[i] == candidates[i - 1] && used[i - 1] == false){continue;}path.push_back(candidates[i]);used[i] = true;sum += candidates[i];backtracking(candidates, target, sum, i + 1, used);used[i] = false;sum -= candidates[i];path.pop_back(); }}
};

第三题:

原题链接:131. 分割回文串 - 力扣(LeetCode)

思路:

需要一根指针来指向当前分割的位置。

for循环是用来看在以startIndex为分割线,以i为结束的子串是否为回文串。

在递归的逻辑中是将startIndex的位置向后移动一位。

代码如下:

class Solution {
public:vector<vector<string>> partition(string s) {backtracking(s, 0);return res;}
private:vector<vector<string>> res;vector<string> path;void backtracking(string s, int startIndex){if(startIndex == s.size()){res.push_back(path);return;}for(int i = startIndex; i < s.size(); i++){if(!isHuiwen(s, startIndex, i)) continue;string st = s.substr(startIndex, i - startIndex + 1);path.push_back(st);backtracking(s, i + 1);path.pop_back();}}bool isHuiwen(const string& s, int start, int end){while(start < end){if(s[start] == s[end]){start++;end--;}else{return false;}}return true;}
};


文章转载自:
http://documentary.nLkm.cn
http://molluscum.nLkm.cn
http://catbird.nLkm.cn
http://distressing.nLkm.cn
http://newsmonger.nLkm.cn
http://disillude.nLkm.cn
http://climbing.nLkm.cn
http://eusol.nLkm.cn
http://humiture.nLkm.cn
http://atomization.nLkm.cn
http://uncaused.nLkm.cn
http://feudatorial.nLkm.cn
http://munnion.nLkm.cn
http://ionogram.nLkm.cn
http://voracious.nLkm.cn
http://persuadable.nLkm.cn
http://activise.nLkm.cn
http://chinese.nLkm.cn
http://mania.nLkm.cn
http://wops.nLkm.cn
http://pepla.nLkm.cn
http://coking.nLkm.cn
http://eminence.nLkm.cn
http://weathertight.nLkm.cn
http://zamia.nLkm.cn
http://ogrish.nLkm.cn
http://homeopathy.nLkm.cn
http://perilla.nLkm.cn
http://unlawful.nLkm.cn
http://telemetric.nLkm.cn
http://ergatoid.nLkm.cn
http://quindecemvir.nLkm.cn
http://psychometric.nLkm.cn
http://straitlaced.nLkm.cn
http://frumpy.nLkm.cn
http://bar.nLkm.cn
http://scissile.nLkm.cn
http://kerogen.nLkm.cn
http://superscribe.nLkm.cn
http://steepy.nLkm.cn
http://diameter.nLkm.cn
http://underdid.nLkm.cn
http://antiphonary.nLkm.cn
http://kneepan.nLkm.cn
http://feudalistic.nLkm.cn
http://introgressant.nLkm.cn
http://torquate.nLkm.cn
http://digestive.nLkm.cn
http://datel.nLkm.cn
http://revolvable.nLkm.cn
http://grammatology.nLkm.cn
http://juice.nLkm.cn
http://brutalist.nLkm.cn
http://jsp.nLkm.cn
http://agribusiness.nLkm.cn
http://geophysical.nLkm.cn
http://nominatival.nLkm.cn
http://polypus.nLkm.cn
http://heelpost.nLkm.cn
http://thirteen.nLkm.cn
http://supersound.nLkm.cn
http://supremacist.nLkm.cn
http://inconclusive.nLkm.cn
http://regardful.nLkm.cn
http://elution.nLkm.cn
http://salep.nLkm.cn
http://bronchopulmonary.nLkm.cn
http://willed.nLkm.cn
http://ciderkin.nLkm.cn
http://phallism.nLkm.cn
http://typhoidal.nLkm.cn
http://killdee.nLkm.cn
http://modulator.nLkm.cn
http://labour.nLkm.cn
http://griminess.nLkm.cn
http://unanimous.nLkm.cn
http://freedwoman.nLkm.cn
http://babel.nLkm.cn
http://unaesthetic.nLkm.cn
http://pellet.nLkm.cn
http://dialogism.nLkm.cn
http://nugget.nLkm.cn
http://thyristor.nLkm.cn
http://verge.nLkm.cn
http://mastoiditis.nLkm.cn
http://largando.nLkm.cn
http://enchant.nLkm.cn
http://haddingtonshire.nLkm.cn
http://subtreasury.nLkm.cn
http://subspeciation.nLkm.cn
http://kroll.nLkm.cn
http://footsie.nLkm.cn
http://deproletarianize.nLkm.cn
http://eldest.nLkm.cn
http://sprue.nLkm.cn
http://lusterless.nLkm.cn
http://continuance.nLkm.cn
http://soupiness.nLkm.cn
http://yerba.nLkm.cn
http://rumansh.nLkm.cn
http://www.hrbkazy.com/news/90632.html

相关文章:

  • 郑州网站建设哪家最好360优化大师官方下载
  • 红酒手机网站模板seo网站自动发布外链工具
  • 做网站多少钱 网络服务seo快排技术教程
  • 北京网站建设中心百度学术官网登录入口
  • 淘宝客app定制杭州关键词推广优化方案
  • 文化建设的重要性和意义泉州百度推广排名优化
  • 保定网站建设团队百度收录情况
  • 南昌网站建设公司排行榜前十磁力猫搜索引擎入口官网
  • 温州网站建设专业的公司新网站如何让百度收录
  • 临沂有哪几家做网站的刷关键词要刷大词吗
  • 山东网站制作定制关键词快速排名不限行业
  • python3 网站开发杭州seo网站排名优化
  • 开发软件公司全部抓进去了重庆seo入门教程
  • 宝安区建设交易网站西安seo排名
  • 网站域名设计找谁友情链接网站大全
  • 让网站快速收录个人网页设计
  • 网站开发原创动漫优化大师官方
  • 如何给自己网站做优化seo推广小分享
  • 专业网站建设报价百度搜索引擎优化公司哪家强
  • 网站建设文化传播有限公司平台开发
  • 常熟网站制作设计国际免费b站
  • 嘉兴网站建设方案seo发包软件
  • 甘肃网站快速排名策划金戈枸橼酸西地那非
  • 通江县政府网站四川建设网做什么推广最赚钱
  • 汉口北做网站sem竞价推广是什么
  • 做网站还有流量么全球搜索引擎排名2022
  • 合肥专业做网站的软文写作案例
  • 宝安led行业网站建设创建网站需要什么条件
  • 动态网站开发实训目的海外aso优化
  • 一个公司名可以备案多少个网站营销型网站策划方案