2015年1月28日
摘要: 思路:由指数型母函数的知识f(x)=(1+x/1!+x^2/2!+x^3/3!...+x^n/n!)^2+(1+x^2/2!+x^4/4!+x^6/6!...+...)^2;又由大学的泰勒公式:e^x=1+x/1!+x^2/2!+x^3/3!...+x^n/n!;e^(-x)=1-x/1!+x^2/... 阅读全文
posted @ 2015-01-28 13:40 Unc、 阅读(262) 评论(0) 推荐(0) 编辑
  2015年1月21日
摘要: 匈牙利算法:http://blog.csdn.net/dark_scope/article/details/8880547代码:#include#includeusing namespace std;const int N = 505;bool map[N][N],used[N];int pre[N... 阅读全文
posted @ 2015-01-21 18:04 Unc、 阅读(287) 评论(0) 推荐(0) 编辑
  2015年1月20日
摘要: Catalan数: 令h(1)=1,h(0)=1,catalan数满足递归式: h(n)= h(1)*h(n-1) + h(2)*h(n-2) + ... + h(n-1)h(1) (其中n>=2) 另类递归式: h(n)=((4*n-2)/(n+1))*h(n-1); 该递推关系的解... 阅读全文
posted @ 2015-01-20 22:24 Unc、 阅读(665) 评论(0) 推荐(0) 编辑
  2015年1月18日
摘要: #include//错排公式f(0)=1;__int64 a[15]={1,0,1,2};int C_n_m(int n,int m){ __int64 u=1,d=1; if(m>n/2)m=n-m; for(int i=0;i<m;++i) { u*=(n-... 阅读全文
posted @ 2015-01-18 18:35 Unc、 阅读(206) 评论(0) 推荐(0) 编辑
摘要: 母函数#include#include#define min(a,b) ((a)<(b)?(a):(b))int N,v[26],n[26],a[55],b[55],i,j,k,last,last2,sum;int main(){ scanf("%d",&N); while(N--... 阅读全文
posted @ 2015-01-18 17:59 Unc、 阅读(250) 评论(0) 推荐(0) 编辑
  2014年12月14日
摘要: 题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3798学会了对于序列用next_permutation暴力打表可以先打表找规律#include#include#define INF 0x3f3f3f3f//#defin... 阅读全文
posted @ 2014-12-14 14:12 Unc、 阅读(232) 评论(0) 推荐(0) 编辑
  2014年12月8日
摘要: 巴什博弈:一个人拿1~m个,那谁面对m+1的局势的的时候则必败。假设n=k*(m+1)+s,(k为任意,s 2 int main() 3 { 4 int t, n, m; 5 scanf("%d", &t); 6 while (t--){ 7 scanf("%... 阅读全文
posted @ 2014-12-08 20:07 Unc、 阅读(193) 评论(0) 推荐(0) 编辑
  2014年12月1日
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1010贴个资料:http://acm.hdu.edu.cn/forum/read.php?tid=6158奇偶剪枝:对于从起始点 s 到达终点 e,走且只走 t 步的可达性问题的一种剪枝策略。如下列矩阵 :从... 阅读全文
posted @ 2014-12-01 13:50 Unc、 阅读(217) 评论(0) 推荐(0) 编辑
  2014年11月24日
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=1003简单dp,状态转移方程:sum[i] = max{sum[i-1]+a[i],a[i]}. (sum[i]记录以a[i]为子序列末端的最大连续和.)对于a[i]这个数字,我们考虑是否将它选入之前连续的序... 阅读全文
posted @ 2014-11-24 18:32 Unc、 阅读(304) 评论(0) 推荐(0) 编辑
  2014年11月22日
摘要: 题目:http://acm.hdu.edu.cn/showproblem.php?pid=2795 1 #include 2 #include 3 using namespace std; 4 #define lson l,m,rt> 1;18 build(lson);19 buil... 阅读全文
posted @ 2014-11-22 23:21 Unc、 阅读(281) 评论(0) 推荐(0) 编辑