博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
P1119 灾后重建
阅读量:6981 次
发布时间:2019-06-27

本文共 727 字,大约阅读时间需要 2 分钟。

能看出来是多源最短路。只能用floyed。

但是这道题确实加深了我对floyed的理解

#include
#include
#include
#include
using namespace std;int tim[210];bool able[210];bool map[210][210];int dis[210][210];/*struct node{ int point; int nxt; int weight;};node line[50000];int head[5100],tail;void add(int x,int y,int z){ line[++tail].point=y; line[tail].weight=z; line[tail].nxt=head[x]; head[x]=tail;}垃圾*/int main(){ int n,m; scanf("%d%d",&n,&m); for(int i=0;i
c||tim[b]>c) { printf("-1\n"); continue; } printf("%d\n",dis[a][b]); } return 0;}

转载于:https://www.cnblogs.com/Lance1ot/p/8659094.html

你可能感兴趣的文章
RedHat Linux KVM安装配置
查看>>
01 jquery easyui 入门示例
查看>>
oracle rac 扩展磁盘采坑记录
查看>>
Deprecated:function eregi() is deprecated in /usr/local/apache/libraries/lib_lang.php on line 8
查看>>
2.shell前基础知识
查看>>
resin4 配置https
查看>>
mysql备份脚本
查看>>
monit安装
查看>>
为什么你的服务器被列入垃圾邮件?
查看>>
游戏角色动作太羞耻?现在AI能帮忙了(也有论文)
查看>>
phpcms 调用多级栏目和多级栏目下的文章列表
查看>>
InputStream与OutputStream的使用例子
查看>>
人工智能应用范围那么广,但融资最多的还是医疗卫生
查看>>
计算机网络概述
查看>>
邮件服务器搭建之:详解Dovecot配置
查看>>
macbook中的一些快捷功能
查看>>
将CISCO 1242AG转换成胖AP
查看>>
图文并茂讲解VMware三种网络模式
查看>>
Ubuntu14.04搭建LAMP
查看>>
思科4506E交换机系统升级那点事!
查看>>