http://162.105.203.28/course/ada09/students/00748244-YT-HungaryAlgorithm.pdf(求二分图完备匹配的KM算法) http://www.cnblogs.com/penseur/archive/2013/06/16/3138981. Read More
=============================以下是最小生成树+并查集======================================【HDU】1213 How Many Tables基础并查集★1272 小希的迷宫基础并查集★1325&&poj1308 Is It A Tr... Read More
题意:一个数n,给出n个数,再给一个数k。求能整除k的连续区间和所在区间的最大长度。bc85场1001的升级版。 题解:刚拿到题的时候没看清是连续区间,就瞎想dp。发现连续区间后,想尺取法,发现这道题是离散的,没法尺取,也没法二分。 正解应该是前缀和取模。若(sum[j]-sum[i])%k==0则 Read More
#include #include #include using namespace std; char s[60]; int l; typedef long long int64; int get(){ int i=l-1; while(i>0&&s[i-1]>=s[i]) i--; if(!i) return 0; int mp=i; for(int j=i+1;j<l;... Read More
题意:每次给出与第i个点相邻的点,得到有向图后求哈密顿回路;参考:http://blog.csdn.net/volzkzg/article/details/7514103思路:由一点求相邻的链,构成环,再将不在环上的点加入环上,环上的点数为n时为哈密顿回路;#include #include ... Read More