- 博客(3)
- 收藏
- 关注
原创 线段树的简单实现
/*sample input:61 7 2 5 6 3sample output799*/#include <iostream>using namespace std;//N is the maximum element number of an arrayconst int N = 51;const int MAXNODES=2*N;int a[N];struct treeN
2018-03-12 16:55:27
210
原创 多重背包问题的实现
POJ1276 之前看过一遍背包九讲,没有深刻体会,今天碰到了多重背包的模板题=。=Problem:Cash MachineDescription A Bank plans to install a machine for cash withdrawal. The machine is able to deliver appropriate @ bills for a reques...
2018-03-11 19:26:42
618
原创 不是你想象中的组合数计算
我们印象中计算组合数的公式 C(kn)=A(kn)A(kk)C\binom{k}{n}=\frac{A{k \choose n}}{A{k \choose k}}但其实,还有另外一个,常见于编程使用 C(kn)=C(k−1n−1)+C(kn−1)C{k \choose n}=C{k-1 \choose n-1}+C{k \choose n-1}Problem:挑选子集Description 给
2018-03-05 23:41:32
738
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人