码迷,mamicode.com
首页 >  
搜索关键字:sum root to leaf num    ( 81521个结果
UVA 562 Dividing coins --01背包的变形
01背包的变形。先算出硬币面值的总和,然后此题变成求背包容量为V=sum/2时,能装的最多的硬币,然后将剩余的面值和它相减取一个绝对值就是最小的差值。代码:#include #include #include #include #include using namespace std;#define...
分类:其他好文   时间:2014-04-28 09:53:54    阅读次数:645
图的存储方式
昨天 听caicai讲了几种关于图的存储方式 又学了好多 家有caicai 如有一宝 -> 转自 晓爷下面 我所讲的 都是基于 有向图的建图方式i:map[a][b] ---最基础的邻接矩阵 直接用二维数组ii: 1 struct graph 2 { 3 int num; // ---指向...
分类:其他好文   时间:2014-04-28 06:05:45    阅读次数:463
[C++11新特性]第二篇
0.可变数量参数,可变函数模版,变长模版类 c++98可变数量参数 #include#includedouble SumOfFloat(int count, ...){ va_list ap; double sum=0; va_start(ap,count); for(int i=0;i#inclu...
分类:编程语言   时间:2014-04-28 05:08:44    阅读次数:661
Shallow Size 和 Retained Size
所有包含Heap Profling功能的工具(MAT, Yourkit, JProfiler, TPTP等)都会使用到两个名词,一个是Shallow Size,另一个是 Retained Size. 这是两个在平时不太常见的名词,本文会对这两个名词做一个详细的解释。Shallow Size对象自身占...
分类:其他好文   时间:2014-04-28 04:44:45    阅读次数:455
素数求和
#include using namespace std;int fun(int a){ if(a==1) return 0; for(int i=2;i>M; while(M--) { int i,sum=0; cout>N; ...
分类:其他好文   时间:2014-04-27 22:06:54    阅读次数:578
BZOJ1858: [Scoi2010]序列操作
这题我很二的折腾了一下午,唉,还是太弱了。这题的关键在于标记的更新与更新每个点的权值,更新标记我很快就写好了,思路很清晰,但是查找答案就头晕了,在处理下传标记、更新权值中纠结。。。。这题我用sum来记录一段区间内1的个数,lest记录该区间从左往右连续的1的个数,rest记录该区间从右往左连续的1的...
分类:其他好文   时间:2014-04-27 22:01:03    阅读次数:549
[Leetcode] 4Sum
Given an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum of ...
分类:其他好文   时间:2014-04-27 20:55:03    阅读次数:567
hdu4104 Discount
给n个数,问最小不能组成的正整数是多少。 数学归纳法。 从sum=0开始,每次考察sum+1>=a[i],则sum+1肯定可以达到,那么sum+a[i]以内的数肯定可以达到。 #include #include #include #include #include #include #include #include #include #define...
分类:其他好文   时间:2014-04-27 20:06:50    阅读次数:554
Extjs 4.2 树结点右键菜单(全选,反选,撤销)
自己写的最新版本extjs4.2的树结点的操作,记录一下,以后可能会用到。 var tree = new Ext.tree.TreePanel({ flex: 1, animate: true,   autoScroll: true, anchor: '100% 93%', store: new Ext.data.TreeStore({ root:{ expanded: true...
分类:Web程序   时间:2014-04-27 19:00:19    阅读次数:1278
linux vncserver 远控
在Linux上启动VNC Server(如果没安装的话那就先安装) 执行vncserver命令: [root@linux root]# vncserver You will require a password to access your desktops. Password: ----为了不想任何人都可以任意遥控此计算机。因此当第 Verify: ---1次启动VNC se...
分类:系统相关   时间:2014-04-27 18:33:08    阅读次数:1009
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!