摘要: 使用STL中的next_permutation(opt1,opt2)函数更容易实现。opt1为数组头地址,opt2为数组长度。排列是按字典序的。当找到下一个排列时,返回真,否则返回假,此时,把原数组重排一次。#include #include #include using namespace std... 阅读全文
posted @ 2014-09-24 20:11 chenjunjie1994 阅读(143) 评论(0) 推荐(0) 编辑
摘要: 第一题组合数学题。可以使用递推,设1与其他各数分别连边,假设N=3;若1-4,则圆分成两部分计数,此时可以利用乘法原理。(高精度)#include #include #include #include using namespace std;const int maxn = 200;struct b... 阅读全文
posted @ 2014-09-24 19:41 chenjunjie1994 阅读(259) 评论(0) 推荐(0) 编辑