Description
给出一个城市的地图(用邻接矩阵表示),商店设在一点,使各个地方到商店距离之和最短。
Input
第一行为n(共有几个城市); N小于201
第二行至第n+1行为城市地图(用邻接矩阵表示);
Output
最短路径之和;
Sample Input
3
0 3 1
3 0 2
1 2 0
Sample Output
3
前言
之前用的是SPFA,但不知为什么错了
有知道错误的 d a l a o dalao dalao,麻烦在评论区告诉我
#include<iostream>
#include<cstdio>
#include<queue>
#define INF 1e9
using namespace std;
int f[1005][1005],dis[1005];
int n,m,ans=INF;
bool b[1005];
int main()
{
scanf("%d",&n);
for(int i=1;i<=n;++i)
for(int j=1;j<=n