1.图类基本组成 存储在邻接表中的基本项 /** * Represents an edge in the graph * */ class Edge implements Comparable<Edge> { public Vertex dest; //Second vertex in Edge public double cost; //Edge cost public Edge(Vertex d, double c) { dest = d; cost = c; } @Override pu
最大流模板题 大部分Edmond-Karp算法代码都是邻接矩阵实现,试着改成了邻接表. #include <iostream> #include <cstdio> #include <queue> #include <cstring> using namespace std; // 裸最大流 const int N = 2005; const int M = 2005; const int INF = 0x7fffffff; // 邻接表 struct Ed
The Accomodation of Students Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 3565 Accepted Submission(s): 1659 Problem Description There are a group of students. Some of them may know each ot
畅通工程 Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total Submission(s): 35957 Accepted Submission(s): 15971 Problem Description 省政府“畅通工程”的目标是使全省任何两个村庄间都可以实现公路交通(但不一定有直接的公路相连,只要能间接通过公路可达即可).经过调查评估,得到的统计表中列出了有可能建