最短路。 先建一个只包含最短路的有向无环图,每一个点选择任意一条入边即可生成一个树形图,那么树的种类就等于每个点的入度乘积。 ...
分类:
其他好文 时间:
2017-05-07 20:01:52
阅读次数:
200
Vertex Cover frog has a graph with \(n\) vertices \(v(1), v(2), \dots, v(n)\) and \(m\) edges \((v(a_1), v(b_1)), (v(a_2), v(b_2)), \dots, (v(a_m), v( ...
分类:
其他好文 时间:
2017-05-01 12:05:54
阅读次数:
253
There is a tree of N nodes which are numbered from 1 to N. Unfortunately, its edges are missing so we don't know how the nodes are connected. Instead ...
分类:
其他好文 时间:
2017-04-13 12:41:09
阅读次数:
233
1 //Five edges polygon. 2 //As less code as possible. 3 4 #include "stdafx.h" 5 #include 6 #include 7 8 void init(void) 9 { 10 glClearColor(0.0, 0.0, ... ...
分类:
其他好文 时间:
2017-04-12 02:54:16
阅读次数:
208
图类的构建 function Graph(v) {this.vertices = v;this.edges = 0;this.adj = []; for (var i = 0; i < this.vertices; ++i) { this.adj[i] = []; this.adj[i].push( ...
分类:
Web程序 时间:
2017-04-09 17:20:28
阅读次数:
213
最小生成树问题#include using namespace std; #define MAX 20 #define INF 32767 int edges[MAX][MAX]; void prim(int v,int arr[MAX][MAX]) { int n=8; int lowcost[M... ...
分类:
其他好文 时间:
2017-04-05 22:30:02
阅读次数:
214
const int maxn=28; struct Edge{ int u,v,w; bool operator <(const Edge &rhs) const{ return w<rhs.w; } }edges[maxn*maxn]; int f[maxn]; void init(int N){... ...
分类:
编程语言 时间:
2017-04-01 21:14:55
阅读次数:
170
- (void)viewDidLoad { [super viewDidLoad]; // Do any additional setup after loading the view, typically from a nib. self.title = @"卡牌翻转效果"; self.edges ...
分类:
移动开发 时间:
2017-03-29 15:54:59
阅读次数:
1836
题意:给你一个无向图,每个点都是大写字母,让你计算最小生成树的权值 ps:%c最好别用,%s才是最好的选择,大写字母转化成对应的序列位置可以 -'A'+1 然后fa[maxn]要初始化,edges[maxn*maxn]的大小要maxn*maxn,还要按边权排个序... 1 #include<iost ...
分类:
其他好文 时间:
2017-03-29 00:55:45
阅读次数:
196
Query on a tree You are given a tree (an acyclic undirected connected graph) with N nodes, and edges numbered 1, 2, 3...N-1. We will ask you to perfro ...
分类:
其他好文 时间:
2017-01-28 16:38:54
阅读次数:
252