码迷,mamicode.com
首页 >  
搜索关键字:max sum plus plus    ( 46271个结果
概率与统计知识复习
一. 随机变量1.1 概率分布概率分布 定义 : 随机变量X取各个值$x_i$的概率称为X的概率分布. 对于离散型随机变量: $ P(X=x_i)=p_i, (i=1,2,3,...) $ 特性 : a. $p_i>0$ b. $\sum_i^{\infty} p_i =1 $累积概率分布(CDF)...
分类:其他好文   时间:2014-07-16 19:28:51    阅读次数:340
[LeetCode] Combination Sum
1 void func(const vector & candidates, int target, vector & path, int cur , int sum , vector > & ret ) 2 { 3 if( sum == ...
分类:其他好文   时间:2014-07-16 19:24:59    阅读次数:225
nyoj 927 The partial sum problem
The partial sum problem时间限制:1000 ms | 内存限制:65535 KB 难度:2描述One day,Tom’s girlfriend give him an array A which contains N integers and asked him:Can you...
分类:其他好文   时间:2014-07-16 19:24:53    阅读次数:181
【LeetCode】Sum Root to Leaf Numbers
题目Given a binary tree containing digits from0-9only, each root-to-leaf path could represent a number.An example is the root-to-leaf path1->2->3which r...
分类:其他好文   时间:2014-07-15 23:21:33    阅读次数:218
C++程序的编写和实现
C++程序的编写和实现 一个程序从编写到最后得到运行结果要经历以下一些步骤。1. 用C++语言编写程序 用高级语言编写的程序称为“源程序”(source program)。C++的源程序是以.cpp作为后缀的(cpp是c plus plus 的缩写)。2. 对源程序进行编译 为了使计算机能执行...
分类:编程语言   时间:2014-07-15 09:25:44    阅读次数:326
[华为机试]输入一个正整数,输出2000年1月1日经过该整数天后的日期.
//输入一个正整数,输出2000年1月1日经过该整数天后的日期.已测试,输入值可以为0~1095727//如,100天后,日期为2000 4 10#include#define MAX_YEAR 5000//年数可以从2000一直到4999年。//函数功能:求解第year年共有多少天int day_...
分类:其他好文   时间:2014-07-15 09:10:04    阅读次数:525
[leetcode]3Sum
3SumGiven an arraySofnintegers, are there elementsa,b,cinSsuch thata+b+c= 0? Find all unique triplets in the array which gives the sum of zero.Note:El...
分类:其他好文   时间:2014-07-15 08:51:50    阅读次数:231
[leetcode]3Sum Closest
3Sum ClosestGiven an arraySofnintegers, find three integers inSsuch that the sum is closest to a given number, target. Return the sum of the three int...
分类:其他好文   时间:2014-07-14 15:23:22    阅读次数:171
[leetcode]4Sum
4SumGiven an arraySofnintegers, are there elementsa,b,c, anddinSsuch thata+b+c+d= target? Find all unique quadruplets in the array which gives the sum...
分类:其他好文   时间:2014-07-14 15:02:09    阅读次数:228
NSum小结
本文载自【k sum problem】以及【NSum】有位同僚,对该问题做出了代码的小结,想看吗?戳我戳我。问题陈述:在一个数组,从中找出k个数(每个数不能重复取。数组中同一个值有多个,可以取多个),使得和为零。找出所有这样的组合,要求没有重复项(只要值不同即可,不要求在原数组中的index不同)解...
分类:其他好文   时间:2014-07-14 14:16:00    阅读次数:219
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!