随笔分类 - 图论——最短路
摘要:#include #include #include #include #include #include #include using namespace std;const int maxe = 200010;const int maxn = 100010;const int INF = 0x3f3f3f3f;struct Edge{ int u,v,w; int next; Edge(int u=0,int v=0,int w=0,int next=0): u(u), v(v), w(w) ,next(next){}};struct Heap{ int u,le...
阅读全文
摘要:题目链接:http://poj.org/problem?id=2449#include#include#include#include#includeusing namespace std;const int maxn = 1005;const int maxe = 100050;const int INF = 0x3f3f3f3f;struct Edge{ int v,w; int next; Edge(int v=0,int w=0,int next=0): v(v), w(w), next(next){}};struct Heap{ int u,f...
阅读全文
摘要:题目链接:http://poj.org/problem?id=1556#include#include#include#include#include#includeusing namespace std;const int maxn = 1000;const int maxe = 20000;const int INF = 0x3f3f3f;const double eps = 1e-8;const double PI = acos(-1.0);struct Point{ double x,y; Point(double x=0, double y=0) : x(x),y(y){...
阅读全文
摘要:题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=3409参考博客:http://www.cnblogs.com/woaishizhan/p/3189813.html#include#include#include#include#include#include#includeusing namespace std;const int maxn = 205;const int maxe = 20500;const int INF = 0x3f3f3f;struct Edge{ int u,v,w; int next; void as...
阅读全文
摘要:题目链接:http://poj.org/problem?id=1161#include #include #include #include #include #include #include #define maxn 400#define INF 0x3f3f3f#define min(a,b) (a>b?b:a)using namespace std;int first[maxn][maxn]; int d[maxn][maxn];vector G[maxn];int N,M,L;int mem[35];void floyd(){ for(int k=1;k<=M;k++)
阅读全文
摘要:#include<iostream>#include<cstdio>#include<cstring>#include<queue>#include<algorithm>using namespace std;const int maxn = 1005;const int maxm = 100005;const int INF = 0x3f3f3f3f;int N,M,X;int first[maxn];int en;int d[maxn],d1[maxn];struct Edge{ int u,v,w; int next; void
阅读全文
摘要:只能说我被一个小错搞得好心痛,本一写好代码感觉写的还优美,但一个小的不能再小的 i 写出u ,害的我正正调了一天。还不的不与别人对比看。OMG!!具体的分析找别人的吧,说的比我好,要吃个苹果放松下#include <cstdio>#include <cmath>#include <algorithm>#include <iostream>#include <queue>#define maxn 1005using namespace std;const int INF = 0x3f3f3f;double mid;struct Edge
阅读全文