码迷,mamicode.com
首页 >  
搜索关键字:binary tree right si    ( 32903个结果
hoj Counting the algorithms
贪心加树状数组 给出的数据可能出现两种情况,包含与不包含,但我们从右向左删就能避免这个问题; #include #include #include using namespace std; const int maxn=200010; int f[maxn],l[maxn],a[maxn]; long long tree[maxn]; int n; inline int lowbit(int ...
分类:其他好文   时间:2014-07-22 00:27:36    阅读次数:210
hdu 1166线段树
线段树的一般模板,1.结构体数组tree来存储 2.线段树的构建函数buildTree 3.改变元素值函数update 4.查询区间内总和的函数query全部使用递归来实现 ######################################################################include #include #include #include us...
分类:其他好文   时间:2014-07-21 11:44:15    阅读次数:183
STL_稀疏图,树_使用vector邻接表存储
本文出自:http://blog.csdn.net/svitter 分析:vector是STL模板中的容器。可以利用其性质来构建邻接表。 定义: #include #define MAXN 10000 //max n of a tree or graph //if is a tree, n / 2 is OK ; using namespace std; typedef ve...
分类:其他好文   时间:2014-07-21 11:27:55    阅读次数:228
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!