编程技巧
文章平均质量分 62
Iscream12138
三思而后行,再,斯可矣
展开
-
多重背包问题的实现
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 · 598 阅读 · 0 评论 -
不是你想象中的组合数计算
我们印象中计算组合数的公式 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 · 688 阅读 · 0 评论