上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 99 下一页

2012年3月8日

二分图KM算法 HDU 2255

摘要: 在百度百科学了KM算法。。km算法是求完备匹配下的最大权KM算法流程:1.对二分图的两部分顶点初始化2.KM算法用匈牙利算法寻找完备匹配3.如果未找到就修改相应顶点值4重复(2)(3)直到找到相等子图的完备匹配为止;HDU 2255是裸题。。未优化版:View Code #include<stdio.h>#include<string.h>#include<stdlib.h>int match[1000];int mp[400][400];bool visitx[400], visity[400];int xx[400], yy[400];const int 阅读全文

posted @ 2012-03-08 14:11 more think, more gains 阅读(285) 评论(0) 推荐(0) 编辑

2012年3月7日

简单二分图匹配

摘要: 1.HDU 2063 过山车模板题。。View Code #include <stdio.h>#include <string.h>#include <stdlib.h>#include <algorithm>#include <queue>#include <deque>#include <list>#include <map>#include <set>#include <stdlib.h>#include <time.h>using namespace st 阅读全文

posted @ 2012-03-07 22:14 more think, more gains 阅读(170) 评论(0) 推荐(0) 编辑

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) 编辑

2012年3月5日

I HATE IT 伸展树

摘要: View Code #include <stdio.h>#include <string.h>#include <algorithm>#include <stdlib.h>#include <math.h>#include <algorithm>#include <time.h>using namespace std;int left[200100], right[200100], maxn[200100], pf[200100], value[200100],root; //值为-1的点表示该结点为空 voi 阅读全文

posted @ 2012-03-05 00:54 more think, more gains 阅读(175) 评论(0) 推荐(0) 编辑

上一页 1 ··· 24 25 26 27 28 29 30 31 32 ··· 99 下一页

导航