2014年3月16日

组合数求解

摘要: 参考以下这篇博文,在这个基础上进行了一些改进,可以去除组合数中的重复项。参考博文:http://blog.csdn.net/dremi/article/details/1940723改进后的代码如下:#include using namespace std;void com(int *arr,int idx[], int start, int cnt, const int &m, const int &n){ if(start + cnt > m) return ; if(cnt == 0) //cnt为0 表示选取了n个元素了,即找到了一个组合. { for(int i 阅读全文

posted @ 2014-03-16 12:23 jesse_deng 阅读(303) 评论(0) 推荐(0) 编辑

导航