2012年3月6日

母函数

摘要: 晚上写了几道简单的母函数。母函数万变不离其宗。。1.HDU1171View Code #include <stdio.h>#include <string.h>#include <stdlib.h>int value[2000], num[2000];int c1[250010], c2[250010];int sum = 0;void fun(int N){ int cnt = num[1]; memset(c1, 0, sizeof(c1)); memset(c2, 0, sizeof(c2)); for( int i = 0; cnt >= 0; 阅读全文

posted @ 2012-03-06 22:53 more think, more gains 阅读(257) 评论(0) 推荐(0) 编辑

poj 3468 A Simple Problem with Integers

摘要: 1.线段树 2700ms..View Code /*Source CodeProblem: 3468 User: 314911229Memory: 12928K Time: 2704MSLanguage: G++ Result: AcceptedSource Code*/#include <stdio.h>#include <string.h>#include <stdlib.h>struct node{int l, r;long long lazy, sum;}T[500000];long long ans[101000];long long sum... 阅读全文

posted @ 2012-03-06 13:24 more think, more gains 阅读(212) 评论(0) 推荐(0) 编辑

导航