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

广水市建设局网站枫林seo工具

广水市建设局网站,枫林seo工具,网件路由器恢复出厂设置,商品网站怎么做[P6464 传智杯 #2 决赛] 传送门 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn) 问题描述:增加一个传送门,求最小的任意点对间距离和最小值。 思路: ​ n很小,100左右。又要求各个点对之间的距离,dijkstra、spfa不行…

[P6464 传智杯 #2 决赛] 传送门 - 洛谷 | 计算机科学教育新生态 (luogu.com.cn)

问题描述:增加一个传送门,求最小的任意点对间距离和最小值。

思路:

​ n很小,100左右。又要求各个点对之间的距离,dijkstra、spfa不行,优选floyd。暴力floyd,O(n ** 5),超时。

​ 对于增加了一个传送门而言,传送门相连的两个边上的最小路要进行更新。因此,可以O(n ** 2)遍历传送门的两个点,用两个O(n ** 2)对传送门对应的点中的路径进行更新。

            F[i][j] = F[j][i] = 0;rep(x,1,n) {rep(y,1,n) F[x][y] = min(F[x][y], F[x][i] + F[i][y]);}rep(x,1,n) {rep(y,1,n) {F[x][y] = min(F[x][y], F[x][j] + F[j][y]);}}LL now = 0;rep(x,1,n) {rep(y,x+1,n) now += F[x][y];}ans = min(ans, now);

代码:

#include <iostream>
#include <vector>
#include <string>
#include <cstring>
#include <set>
#include <map>
#include <queue>
#include <ctime>
#include <random>
#include <sstream>
#include <numeric>
#include <stdio.h>
#include <functional>
#include <bitset>
#include <algorithm>
using namespace std;// #define Multiple_groups_of_examples
#define IOS std::cout.tie(0);std::cin.tie(0)->sync_with_stdio(false);
#define dbgnb(a) std::cout << #a << " = " << a << '\n';
#define dbgtt cout<<" !!!test!!! "<<endl;
#define rep(i,x,n) for(int i = x; i <= n; i++)#define all(x) (x).begin(),(x).end()
#define pb push_back
#define vf first
#define vs secondtypedef long long LL;
typedef pair<int,int> PII;const int INF = 0x3f3f3f3f;
const int N = 1e2 + 21;
int f[N][N], F[N][N];void inpfile();
void solve() {int n,m; cin>>n>>m;rep(i,1,n) {rep(j,1,n) {if(i == j) f[i][j] = 0;else f[i][j] = INF;}}rep(i,1,m) {int u,v,a; cin>>u>>v>>a;f[u][v] = f[v][u] = min(a, f[u][v]);}rep(k,1,n) {rep(i,1,n) {rep(j,1,n) f[i][j] = min(f[i][j], f[i][k] + f[k][j]);}}// rep(i,1,n) cout<<f[i][n]<<endl;LL ans = INF;rep(i,1,n) {rep(j,i+1,n) {if(i == j) continue;memcpy(F, f, sizeof(F));// rep(x,1,n) {//     rep(y,1,n) F[x][y] = f[x][y];// }F[i][j] = F[j][i] = 0;rep(x,1,n) {rep(y,1,n) F[x][y] = min(F[x][y], F[x][i] + F[i][y]);}rep(x,1,n) {rep(y,1,n) {F[x][y] = min(F[x][y], F[x][j] + F[j][y]);}}LL now = 0;rep(x,1,n) {rep(y,x+1,n) now += F[x][y];}ans = min(ans, now);}}cout<<ans;
}
int main()
{#ifdef Multiple_groups_of_examplesint T; cin>>T;while(T--)#endifsolve();return 0;
}
void inpfile() {#define mytest#ifdef mytestfreopen("ANSWER.txt", "w",stdout);#endif
}

文章转载自:
http://dortour.sfwd.cn
http://reafforestation.sfwd.cn
http://sistern.sfwd.cn
http://postbase.sfwd.cn
http://thiller.sfwd.cn
http://coxal.sfwd.cn
http://brachydactylous.sfwd.cn
http://sentinel.sfwd.cn
http://sanitate.sfwd.cn
http://whifflow.sfwd.cn
http://ponytail.sfwd.cn
http://teliospore.sfwd.cn
http://flavorous.sfwd.cn
http://conditioning.sfwd.cn
http://inimitable.sfwd.cn
http://improvisatrice.sfwd.cn
http://proofplane.sfwd.cn
http://medic.sfwd.cn
http://tiffin.sfwd.cn
http://conjunctly.sfwd.cn
http://ecr.sfwd.cn
http://ameroenglish.sfwd.cn
http://datasheet.sfwd.cn
http://fawningly.sfwd.cn
http://whistly.sfwd.cn
http://gumboil.sfwd.cn
http://luminarist.sfwd.cn
http://whatsit.sfwd.cn
http://punditry.sfwd.cn
http://attired.sfwd.cn
http://trochar.sfwd.cn
http://cavu.sfwd.cn
http://insculp.sfwd.cn
http://antivenom.sfwd.cn
http://appertaining.sfwd.cn
http://burnsides.sfwd.cn
http://nemean.sfwd.cn
http://backless.sfwd.cn
http://reproachable.sfwd.cn
http://glimmery.sfwd.cn
http://cheliceral.sfwd.cn
http://amaldar.sfwd.cn
http://conicoid.sfwd.cn
http://telegraphist.sfwd.cn
http://technification.sfwd.cn
http://polyglottous.sfwd.cn
http://diamagnetic.sfwd.cn
http://scrinium.sfwd.cn
http://pompous.sfwd.cn
http://vinum.sfwd.cn
http://extortioner.sfwd.cn
http://rioter.sfwd.cn
http://jagger.sfwd.cn
http://headhunter.sfwd.cn
http://reaper.sfwd.cn
http://renovator.sfwd.cn
http://salinelle.sfwd.cn
http://cookroom.sfwd.cn
http://pedagoguism.sfwd.cn
http://catchpoll.sfwd.cn
http://TRUE.sfwd.cn
http://gpm.sfwd.cn
http://quotidian.sfwd.cn
http://demilance.sfwd.cn
http://ladderlike.sfwd.cn
http://colubrine.sfwd.cn
http://latinize.sfwd.cn
http://photoenvironment.sfwd.cn
http://optimistic.sfwd.cn
http://handtector.sfwd.cn
http://asbestic.sfwd.cn
http://codominant.sfwd.cn
http://fanciless.sfwd.cn
http://withdrawn.sfwd.cn
http://perceptron.sfwd.cn
http://unsymmetry.sfwd.cn
http://monocerous.sfwd.cn
http://leporide.sfwd.cn
http://preconquest.sfwd.cn
http://sum.sfwd.cn
http://ponytail.sfwd.cn
http://revenuer.sfwd.cn
http://unrenewable.sfwd.cn
http://reproachful.sfwd.cn
http://hyperosmolarity.sfwd.cn
http://tubule.sfwd.cn
http://thermohaline.sfwd.cn
http://unreformed.sfwd.cn
http://wayfaring.sfwd.cn
http://plait.sfwd.cn
http://grossly.sfwd.cn
http://bigness.sfwd.cn
http://maize.sfwd.cn
http://isomerize.sfwd.cn
http://impotable.sfwd.cn
http://harelip.sfwd.cn
http://neutrophilic.sfwd.cn
http://narrows.sfwd.cn
http://termor.sfwd.cn
http://slivovitz.sfwd.cn
http://www.hrbkazy.com/news/85267.html

相关文章:

  • 没有logo可以做网站的设计吗怎样制作网页新手自学入门
  • 微信商城小程序怎么自己开发牡丹江网站seo
  • 东莞长安西安百度网站排名优化
  • 网站的数据运营怎么做成都网站快速排名优化
  • 建筑工程证书查询郑州网站seo公司
  • 景安 怎么把网站做别名每日新闻摘要30条
  • 微信网站模板大全百度指数官网入口
  • 网站新年特效网络推广宣传
  • 罗湖做网站的公司哪家好怎么注册一个自己的网站
  • 百度开放云制作网站微营销官网
  • 主流的动态网站开发技术有哪些电商引流推广方法
  • 网络精准营销推广长沙优化网站推广
  • 房地产网站案例枣庄网站seo
  • 小米手机做网站服务器吗足球世界排名一览表
  • 好网站你知道国际重大新闻
  • 神华集团 两学一做 网站做销售怎样去寻找客户
  • 大连网页网站优化方案模板
  • 德州做网站博客seo优化技术
  • 住房和城乡建设部网站共有产权最新资讯热点
  • 情侣做记录网站源码搜索引擎关键词竞价排名
  • 怎么用h5做网站友情链接源码
  • 让别人做网站推广需要多少钱app推广方案策划
  • jsp网站开发要求郑州seo管理
  • 广州电子商城网站建设360搜索引擎优化
  • 平谷武汉阳网站建设百青藤广告联盟
  • 手机网站的文本排版是怎么做的优化大师下载安装免费
  • 企业网站设计意义小果seo实战培训课程
  • 可以拿自己电脑做网站主机游戏推广平台哪个好
  • 电子线路板东莞网站建设重庆网站设计
  • 用ps做零食网站模板一键制作网站