Problem DescriptionYou may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it is threatened by the rising of sea level. Scientists predict that Nubulsa will disappear by the year of 2012. Nubulsa…
B - Nubulsa Expo Time Limit:3000MS     Memory Limit:0KB     64bit IO Format:%lld & %llu Submit Status Practice UVALive 5099 Description You may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it i…
无向图的最小割.套了个模板. #include<iostream> #include<cstdio> #include<cstring> #include<algorithm> using namespace std; #define MAXN 555 #define inf 1<<30 int v[MAXN],dist[MAXN]; int map[MAXN][MAXN]; bool vis[MAXN]; int n,m,xx; //结点下标从…
Problem Description You may not hear about Nubulsa, an island country on the Pacific Ocean. Nubulsa is an undeveloped country and it is threatened by the rising of sea level. Scientists predict that Nubulsa will disappear by the year of 2012. Nubulsa…
主题链接:点击打开链接 意甲冠军: 给定n个点m条无向边 源点S 以下m行给出无向边以及边的容量. 问: 找一个汇点,使得图的最大流最小. 输出最小的流量. 思路: 最大流=最小割. 所以题意就是找全局最小割. 和源点无关.由于不关心源点在哪个点集里. 模版题: O(n^3) #include <cstdio> #include <cstring> #include <cmath> #include <algorithm> using namespace s…
hdu3002 King of Destruction Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 1022    Accepted Submission(s): 400 Problem Description Zhou xingxing is the successor of one style of kung fu called…
Stoer-Wagner算法基本思想:如果能求出图中某两个顶点之间的最小割,更新答案后合并这两个顶点继续求最小割,到最后就得到答案. 算法步骤: ------------------------------------------------------------------------------------------------------------------------- (1)首先初始化,设最小割ans = INF                                …
前言 StoerWagner算法是一个找出无向图全局最小割的算法,本文需要读者有一定的图论基础. 本文大部分内容与词汇来自参考文献(英文,需***),用兴趣的可以去读一下文献. 概念 无向图的割:有无向图\(G=(V,E)\),设\(C\)为图\(G\)中一些弧的集合,若从\(G\)中删去\(C\)中的所有弧能使图\(G\)不是连通图,称\(C\)图\(G\)的一个割. \(S-T\)割:使得顶点\(S\)与顶点\(T\)不再连通的割,称为\(S-T\)割 \(S-T\)最小割:包含的弧的权和最…
题目链接:http://poj.org/problem?id=2914 思路:算法基于这样一个定理:对于任意s, t   V ∈ ,全局最小割或者等于原图的s-t 最小割,或者等于将原图进行 Contract(s, t)操作所得的图的全局最小割. 算法框架: 1. 设当前找到的最小割MinCut 为+∞ .2. 在 G中求出任意 s-t 最小割 c,MinCut = min(MinCut, c)   .3. 对 G作 Contract(s, t)操作,得到 G'=(V', E'),若|V'| >…
Minimum Cut Time Limit: 10000MS   Memory Limit: 65536K Total Submissions: 8324   Accepted: 3488 Case Time Limit: 5000MS Description Given an undirected graph, in which two vertices can be connected by multiple edges, what is the size of the minimum c…