摘要:
Calling Circles UVA - 247 floyd+dfs 1 #include<cstdio> 2 #include<cstring> 3 #include<vector> 4 #include<map> 5 #include<string> 6 #include<iostream> 阅读全文
摘要:
很好的讲解:http://www.cppblog.com/menjitianya/archive/2015/11/19/212292.html 差分约束: 一:求最大值,转换成求最短路。 给定不等式 A-B<=C; 步骤如下: 既然是求最短路,肯定要用到过程中最重要的【松弛操作】,即 这一步的目的是 阅读全文
摘要:
加减乘除 1 //compare比较函数:相等返回0,大于返回1,小于返回-1 2 int compare(string str1,string str2) 3 { 4 if(str1.length()>str2.length()) return 1; 5 else if(str1.length() 阅读全文
该文被密码保护。 阅读全文
摘要:
SAM I AM UVA - 11419 二分图最小覆盖 二分图的最小顶点覆盖数等于最大匹配数。 且选择的顶点为: 从左边未被匹配的点开始扩展匈牙利树,标记树中的所有节点,取左边未被标记的和右边被标记的。 1 #include <bits/stdc++.h> 2 using namespace st 阅读全文
摘要:
刚刚学了两个最大流算法Dinic和ISAP,很多地方不是很清楚=_=|| 先刷些题练练吧 Drainage Ditches HDU - 1532 题意:求1到n的最大流,裸题 Drainage Ditches HDU - 1532 Drainage Ditches 题意:求1到n的最大流,裸题 可以 阅读全文
摘要:
Ladies' Choice UVALive - 3989 大白书p352 1 #include <bits/stdc++.h> 2 using namespace std; 3 const int maxn=1010; 4 int pref[maxn][maxn],order[maxn][maxn 阅读全文
摘要:
update(2018-01-20): 发现暑假的时候真是zz。。。 学了好久也不是很理解,今天一下就看懂了。。。 之前还以为不用slack的方法更快,理解了之后发现没用slack数组的写法都是错的orz。。。很巧合的过了一些题。。。zz Ants UVALive - 4043 这题真是心态崩了 一 阅读全文
摘要:
dijkstra 1 const int inf=0x3f3f3f3f; 2 const int maxv=1010; 3 const int maxe=1010; 4 5 struct Edge 6 { 7 int u,v,w; 8 int nex; 9 }e[maxe<<1]; 10 int h 阅读全文
摘要:
看了一下午了,,有点迷。。。 割顶和桥:大白书上有说p314 不过桥的方法好像不太实用,,再看这个方法 无向图: 点的双连通(BCC): 大白书p315 边的双连通: 好像还分有没有重边,一种方法是lrj说的,两遍dfs 另一种是像有向图的强连通分量类似的方法(好像是错的,就别看了hhh) 有向图: 阅读全文