题意:给定一张n点m边的图,点带点权,定义点覆盖的权值为点权之积,问所有点覆盖的权值之和膜q n<=36, 1<=a[i]<=1e9,1e8<=q<=1e9 思路:n<=36,考虑middle in the middle分成两个点数接近的点集L和R 对于L,枚举其子集S,判断S能否覆盖所有L内部的边 ...
分类:
其他好文 时间:
2019-10-24 00:14:54
阅读次数:
103
1. calloc(size_t nelems个数, size_t nbytes所需空间): 分配出nelems*nbytes的内存,这块内存里的所有字节初始化为0 2. DFS 所有vertex最多走一次(O(v)),所有标记了visited vertices的都走过(O(E)),时间复杂度为O( ...
分类:
其他好文 时间:
2019-10-20 12:52:36
阅读次数:
74
cv2.rectangle(img, pt1, pt2, color[, thickness[, lineType[, shift]]]) → None img – Image.pt1 – Vertex of the rectangle.pt2 – Vertex of the rectangle o ...
分类:
编程语言 时间:
2019-10-05 20:46:56
阅读次数:
130
A proper vertex coloring is a labeling of the graph's vertices with colors such that no two vertices sharing the same edge have the same color. A colo ...
分类:
其他好文 时间:
2019-10-02 10:33:30
阅读次数:
98
半边数据结构: 网格的顶点,边,面的数据储存在半边数据结构中,半边数据结构写成类似于C语言如下: 半边: struct HE_edge { HE_vert* vert; // vertex at the end of the half-edge HE_edge* pair; // oppositel ...
分类:
其他好文 时间:
2019-09-27 21:20:17
阅读次数:
112
本篇blog讲的是VAO,想看VBO参照上一篇blog。 VAO(vertex array object,顶点数组对象),不得不说......这个名字起得真是鬼畜,名字和功能八竿子打不着。 吐槽归吐槽,该写还是要写的。 我们知道,VBO保存了一个模型的顶点属性信息,每次绘制模型之前我们需要绑定所有的 ...
分类:
其他好文 时间:
2019-09-15 17:06:57
阅读次数:
96
图论基础 , 最短路 图的简单概念 顶点 (Vertex), 边 (Edge) 有向图 , 无向图 , 无向图是一种特殊的有向图 度 ,有向图分为出度 和 入度,无向图的度,代表 连出去的边 顶点 和 边 都可以具有属性,称为 权重 ,顶点称为 点权,边 称为 边权 稠密图 边很多,大约是 顶点的平 ...
分类:
其他好文 时间:
2019-09-08 14:12:29
阅读次数:
99
The "Hamilton cycle problem" is to find a simple cycle that contains every vertex in a graph. Such a cycle is called a "Hamiltonian cycle". In this pr ...
分类:
其他好文 时间:
2019-09-05 23:21:04
阅读次数:
116
Prim算法 1.概览 普里姆算法(Prim算法),图论中的一种算法,可在加权连通图里搜索最小生成树。意即由此算法搜索到的边子集所构成的树中,不但包括了连通图里的所有顶点(英语:Vertex (graph theory)),且其所有边的权值之和亦为最小。该算法于1930年由捷克数学家沃伊捷赫·亚尔尼 ...
分类:
编程语言 时间:
2019-08-30 22:44:27
阅读次数:
95
/*prim算法*/ 1 #include<stdio.h> 2 #include<stdlib.h> 3 #define MAX 1002 4 #define INF 500001 5 6 typedef int Vertex; 7 typedef int Weight; 8 9 typedef ...
分类:
其他好文 时间:
2019-08-25 10:20:09
阅读次数:
94