http://poj.org/problem?id=1125 #include <iostream> #include <cstring> using namespace std; int d[101][101];// dag ATTENTION int num[101];//the number of contracts int edge[101][101];// adjecent edge table int n;//always represent the maxnum of…
题目传送门 /* 最短路:Floyd模板题 主要是两点最短的距离和起始位置 http://blog.csdn.net/y990041769/article/details/37955253 */ #include <cstdio> #include <iostream> #include <algorithm> #include <cmath> #include <cstring> #include <string> #include…
1.链接地址: http://poj.org/problem?id=1125 http://bailian.openjudge.cn/practice/1125 2.题目: Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 24810   Accepted: 13674 Description Stockbrokers are known to overreact to rumou…
链接: http://poj.org/problem?id=1125 http://acm.hust.edu.cn/vjudge/contest/view.action?cid=22010#problem/E Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23440   Accepted: 12854 Description Stockbrokers are known to…
id=1125">链接:poj 1125 题意:输入n个经纪人,以及他们之间传播谣言所需的时间, 问从哪个人開始传播使得全部人知道所需时间最少.这个最少时间是多少 分析:由于谣言传播是同一时候的,对于某条路径使得全部人都知道的时间.不是时间的总和,而是路径中最长的边 从多条路径的最长边,找出最小值.由于为多源最短路,用Floyd比較方便 #include<stdio.h> #include<limits.h> int a[105][105]; void floyd(…
Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 33141   Accepted: 18246 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst th…
点击打开链接 Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 23760   Accepted: 13050 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amo…
题目:http://poj.org/problem?id=1125 题意:给出一个社交网络,每个人有几个别人可以传播谣言,传播谣言需要时间.问要使得谣言传播的最快,应该从那个人开始传播谣言以及使得所有人都知道这个谣言需要多少时间,. 时间的定义是使得最后一个人知道这个谣言的时间.多元最短路 #include <iostream> #include<cstdio> #include<cstring> #include<cstdlib> #include<…
Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to give your employer the tactical edge in the stock market. For maximum effect, you have to spread the…
Floyd算法计算每对顶点之间的最短路径的问题 题目中隐含了一个条件是一个人能够同一时候将谣言传递给多个人 题目终于的要求是时间最短.那么就要遍历一遍求出每一个点作为源点时,最长的最短路径长是多少,再求这些值其中最小的是多少,就是题目所求 #include<bits/stdc++.h> using namespace std; int n,x,p,t; int m[120][120],dist[120][120],Max[120]; void floyd(int n,int m[][120],…