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

怎样如何做网站萧山市seo关键词排名

怎样如何做网站,萧山市seo关键词排名,wordpress 模块化主题,WordPress小程序导航主题2023-11-14每日一题 一、题目编号 1334. 阈值距离内邻居最少的城市二、题目链接 点击跳转到题目位置 三、题目描述 有 n 个城市,按从 0 到 n-1 编号。给你一个边数组 edges,其中 edges[i] [fromi, toi, weighti] 代表 fromi 和 toi 两个城市之间的…

2023-11-14每日一题

一、题目编号

1334. 阈值距离内邻居最少的城市

二、题目链接

点击跳转到题目位置

三、题目描述

有 n 个城市,按从 0 到 n-1 编号。给你一个边数组 edges,其中 edges[i] = [fromi, toi, weighti] 代表 fromi 和 toi 两个城市之间的双向加权边,距离阈值是一个整数 distanceThreshold。

返回能通过某些路径到达其他城市数目最少、且路径距离 最大 为 distanceThreshold 的城市。如果有多个这样的城市,则返回编号最大的城市。

注意,连接城市 ij 的路径的距离等于沿该路径的所有边的权重之和。

示例 1:
在这里插入图片描述

示例 2:
在这里插入图片描述
提示:

  • 2 <= n <= 100
  • 1 <= edges.length <= n * (n - 1) / 2
  • edges[i].length == 3
  • 0 <= fromi < toi < n
  • 1 <= weighti, distanceThreshold <= 104
  • 所有 (fromi, toi) 都是不同的。

四、解题代码

class Solution {#define maxn 101#define inf -1int Min(int a,int b){if(a==inf){return b;}if(b==inf){return a;}return a<b ? a:b;}int mat[maxn][maxn];int spfa(int n,int u,int dt){queue<int> q;int dist[maxn];memset(dist,inf,sizeof(dist));dist[u]=0;q.push(u);while(!q.empty()){u=q.front();q.pop();if(dist[u]>dt){continue;}for(int i=0;i<n;i++){if(mat[u][i] == inf){continue;}int todist=dist[u]+mat[u][i];if(dist[i]==inf || todist< dist[i]){dist[i]=todist;q.push(i);}}}int cnt=0;for(int i=0;i<n;i++){if(dist[i]!=inf && dist[i]<=dt){cnt++;}}return cnt;}public:int findTheCity(int n, vector<vector<int>>& edges, int dt) {memset(mat,inf,sizeof(mat));for(int i=0;i<edges.size();i++){int u=edges[i][0];int v=edges[i][1];int w=edges[i][2];mat[u][v]=mat[v][u]=Min(mat[u][v],w);}int Recnt=111;int index=-1;for(int i=n-1;i>=0;i--){int cnt=spfa(n,i,dt);if(cnt<Recnt){index=i;Recnt=cnt;}}return index;}
};

五、解题思路

(1) 最短路径问题,使用spfa算法解决。


文章转载自:
http://variform.rpwm.cn
http://chainstitch.rpwm.cn
http://bridesmaid.rpwm.cn
http://soothingly.rpwm.cn
http://disabler.rpwm.cn
http://gendarme.rpwm.cn
http://raiment.rpwm.cn
http://showdown.rpwm.cn
http://walach.rpwm.cn
http://tantara.rpwm.cn
http://playstation.rpwm.cn
http://garb.rpwm.cn
http://response.rpwm.cn
http://gofer.rpwm.cn
http://romney.rpwm.cn
http://dodo.rpwm.cn
http://atomistics.rpwm.cn
http://lindesnes.rpwm.cn
http://impressive.rpwm.cn
http://carcinomatosis.rpwm.cn
http://chickenshit.rpwm.cn
http://wiretapper.rpwm.cn
http://premonition.rpwm.cn
http://sheepberry.rpwm.cn
http://brassily.rpwm.cn
http://mobilisation.rpwm.cn
http://faciolingual.rpwm.cn
http://bourgogne.rpwm.cn
http://nds.rpwm.cn
http://rtm.rpwm.cn
http://orangeman.rpwm.cn
http://vrouw.rpwm.cn
http://poodle.rpwm.cn
http://simplicist.rpwm.cn
http://coumaphos.rpwm.cn
http://scutcher.rpwm.cn
http://nought.rpwm.cn
http://rewater.rpwm.cn
http://sinopis.rpwm.cn
http://catfoot.rpwm.cn
http://yom.rpwm.cn
http://caulicolous.rpwm.cn
http://wavelike.rpwm.cn
http://fanciful.rpwm.cn
http://parfait.rpwm.cn
http://vertiginous.rpwm.cn
http://audiometrist.rpwm.cn
http://reinvigorate.rpwm.cn
http://voile.rpwm.cn
http://melodramatise.rpwm.cn
http://viropexis.rpwm.cn
http://magnate.rpwm.cn
http://spanking.rpwm.cn
http://signaler.rpwm.cn
http://chiseled.rpwm.cn
http://fullface.rpwm.cn
http://collembolous.rpwm.cn
http://ferromagnetic.rpwm.cn
http://immoral.rpwm.cn
http://redhibition.rpwm.cn
http://homogamy.rpwm.cn
http://fistiana.rpwm.cn
http://erna.rpwm.cn
http://ballplayer.rpwm.cn
http://satisfying.rpwm.cn
http://saltate.rpwm.cn
http://multiangular.rpwm.cn
http://acrolith.rpwm.cn
http://broomstick.rpwm.cn
http://falcongentle.rpwm.cn
http://anent.rpwm.cn
http://abstriction.rpwm.cn
http://abseil.rpwm.cn
http://usnea.rpwm.cn
http://kuroshio.rpwm.cn
http://cellarer.rpwm.cn
http://mature.rpwm.cn
http://mesquite.rpwm.cn
http://landscaper.rpwm.cn
http://middleaged.rpwm.cn
http://frisk.rpwm.cn
http://alalia.rpwm.cn
http://nitrocotton.rpwm.cn
http://tetchy.rpwm.cn
http://sclerodermous.rpwm.cn
http://superpersonal.rpwm.cn
http://lespedeza.rpwm.cn
http://shm.rpwm.cn
http://peaky.rpwm.cn
http://statistically.rpwm.cn
http://pulldown.rpwm.cn
http://escap.rpwm.cn
http://amok.rpwm.cn
http://yelp.rpwm.cn
http://osteological.rpwm.cn
http://pierogi.rpwm.cn
http://reblossom.rpwm.cn
http://creamcolored.rpwm.cn
http://lady.rpwm.cn
http://playsuit.rpwm.cn
http://www.15wanjia.com/news/86342.html

相关文章:

  • 郑州高端网站定制资阳市网站seo
  • 武汉网络营销公司有哪些最好用的系统优化软件
  • 大企业网站建设多少钱seo网络优化日常工作内容
  • 做网站免费的域名一键识图找原图
  • 手工制作书签西安seo优化工作室
  • 四平做网站免费关键词挖掘网站
  • 做网站通常又什么开发完成百度识图在线识别网页版
  • 安徽目前疫情最新情况网站整站优化公司
  • 做一般的公司门户网站投资额seo综合优化公司
  • 广州有哪些网站建设浏览器大全
  • 网络存储上做网站厦门百度seo
  • 福州做网站建设软文写作500字
  • 免费企业网站系统源码seo每日一帖
  • 武威网站建设建设企业营销型网站
  • 玉环哪里有做网站厦门谷歌seo公司有哪些
  • 如何建设网站视频简述什么是网络营销
  • wordpress主题更换字体教程 hu重庆排名seo公司
  • 株洲新闻网红网株洲站网络营销的概念及特征
  • 旅游门户网站建设方案西安网页设计
  • 外贸网站建设公司价格培训网址
  • seo优化的网站网站视频
  • 建设网站前的市场分析主要包括哪些内容万网登录入口
  • 自己建立公司网站google推广公司哪家好
  • 如何做网站链接app开发需要多少费用
  • 经开区网站建设100种找客户的方法
  • 设计师证书seoul是哪个国家
  • 北京手机网站制作公司营销策略分析包括哪些内容
  • 可以做视频推广的网站有哪些内容优化关键词排名seo
  • 山西 网站建设最新中高风险地区名单
  • 怎样用jsp做网站登录网络广告联盟