一. 随机变量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
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
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
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2021题目大意:给老师发工资,找出最少的人民币张数。 1 #include 2 int main () 3 { 4 int a,n,i,sum; 5 while (scanf("%d",...
分类:
其他好文 时间:
2014-07-13 20:30:07
阅读次数:
162
Add All题意:最优二叉树(priority_queue实现)#include #include #include using namespace std;int main(int argc, char *argv[]){ int n, i, j, a, sum[6000]; pri...
分类:
其他好文 时间:
2014-07-13 20:03:13
阅读次数:
218
求1~n内所有数对(x,y),gcd(x,y)=质数,的对数。
思路:用f[n]求出,含n的对数,最后用sum【n】求和。
对于gcd(x,y)=a(设x
他们乘积的f[i*a]值包括i的欧拉函数值。时间复杂度(n*质数个数)
#include
#include
using namespace std;
const int maxx=100010;
int mindiv[maxx+5],p...
分类:
其他好文 时间:
2014-07-13 16:45:50
阅读次数:
177
poj2479 && poj2593Maximum sum(求两个最大字段的和)...
分类:
其他好文 时间:
2014-07-13 16:18:14
阅读次数:
137
Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.
For example, given the following triangle
[
[2],
[3,4],
[...
分类:
其他好文 时间:
2014-07-13 16:01:42
阅读次数:
209
HDU1003 Max Sum(求最大字段和)...
分类:
其他好文 时间:
2014-07-13 15:33:13
阅读次数:
180
第四章1、sum+=x++;的语句等价于sum=sum+x;和x=x+1;两条语句2、do....while循环语句与while循环语句类似。他们之间的差别是while语句为先判断条件是否成立再执行循环体,而do...while循环语句是先执行一次循环体,在判断条件是否成立。也就是说do....while循环语句至少执行一次..
分类:
编程语言 时间:
2014-07-13 14:18:10
阅读次数:
216