POJ 1125-Stockbroker Grapevine-最短路】的更多相关文章

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],…
http://poj.org/problem?id=1125 题意 : 就是说想要在股票经纪人中传播谣言,先告诉一个人,然后让他传播给其他所有的经纪人,需要输出的是从谁开始传播需要的时间最短,输出这个人的编号和传播需要的最短的时间: 思路 : 典型的最短路问题,就是求最短传播时间,用floyd求出两两最短路.一般来说,因为告诉一个经纪人之后,他可以同时给其他他可以传播的所有人进行传播,所以,只要找到他需要传播的许多人中,找那个传播时间最长的,就能保证他可以给所有他能传播的人都传播到这个谣言,而其…
一.Description 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…
Description 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…
#include<iostream> #include<cstdio> #include<cstring> #include<queue> #define maxn 110 #define pa pair<int,int> using namespace std; int n,num,head[maxn],dis[maxn],ans,len=0x7fffffff,f[maxn]; struct node { int u,v,t,pre; }e[m…
很裸的floyd #include<cstdio> #include<string.h> #include<algorithm> #define maxn 201 #define inf 100000 using namespace std; int map[maxn][maxn],n,x,y,m;; int main() { while(1) { scanf("%d",&n); if(n==0)break; for(int i=1;i<…
Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 37154   Accepted: 20676 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst th…
http://poj.org/problem?id=1125 Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 36045   Accepted: 19999 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation a…
题目链接. 分析: 手感不错,1A. 直接穷举的起点, 求出不同起点到其它点最短路中最长的一条的最小值(好绕). #include <iostream> #include <cstdio> #include <cstring> using namespace std; +; <<); int n, G[maxn][maxn], d[maxn]; int dijkstra(int s) { bool vis[maxn]; memset(vis, , sizeo…
  poj——1125 Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 36112   Accepted: 20033 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformatio…
id=1125">[POJ 1125]Stockbroker Grapevine 最短路 只是这题数据非常水. . 主要想大牛们试试南阳OJ同题 链接例如以下: http://acm.nyist.net/JudgeOnline/talking.php?pid=426&page=2 数据增大非常多 用到非常多东西才干过 (弱没过,.. 这题就是求最短路寻找全部通路中最大权的最小值外加考验英语水平-- Floyd 208K 0MS 1162B #include using namesp…
Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 37069   Accepted: 20612 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: 10000KB   64bit IO Format: %I64d & %I64u Submit Status Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation among…
Stockbroker Grapevine Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 31264 Accepted: 17106 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the st…
题目链接:http://poj.org/problem?id=1125 多源点最短路中的,最长路的,最短路. 看到这里就懵逼了,解释一下,找到一个源点,使得路最短,(遍历源点),路最短怎么求呢? 就是找到从该源点出发,到达所有点中的最长的点的路径,就是他的最短路,然后根据n个源点,找到这样的最长路最短的,就行了. 这里的具体Floyd算法,我还没推过,dis[i][j]从I到J的最短路. #include <stdio.h> #include <string.h> #include…
Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 28231   Accepted: 15659 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst th…
题目链接:http://poj.org/problem?id=3635 题意题解等均参考:POJ 3635 - Full Tank? - [最短路变形][优先队列优化Dijkstra]. 一些口胡: 说实话,上次写类似的二维状态最短路Gym 101873C - Joyride - [最短路变形][优先队列优化Dijkstra],我没能把手写二叉堆优化Dijkstra的给写出来. 这次费了点功夫,也算是给写出来了,需要注意的点还是有点多的.而且我终于深刻理解为啥不推荐手写二叉堆了,主要是代码量相比…
Stockbroker Grapevine Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 26395   Accepted: 14558 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst th…
G. Stockbroker Grapevine Time Limit: 1000ms Memory Limit: 10000KB 64-bit integer IO format: %lld      Java class name: Main   Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amo…
题目大意: 股票经纪人要散播股票的谣言,每个人都有人际关系,每个人只信任他相信的人传播的谣言, 其实也就是有向图.问 哪个人能最快的将谣言传播给所有人,并且求出传过去的最短时间. 题目分析: 我们用Floyd求出每个点的最短路, 然后搜索每个点,看和这个点所连接点的最长时间就是这个人散播最后谣言的时间 然后从所有的点中找出时间最长的点 #include <iostream> #include <cmath> #include <cstring> #include <…
  Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 30454   Accepted: 16659 Description Stockbrokers are known to overreact to rumours. You have been contracted to develop a method of spreading disinformation amongst the stockbrokers to gi…