Stoer-Wagner 算法
题目大意:有重边的无向图,至少删去多少条边能使其变为非连通图?
分析:传统最小割最大流算法需要枚举汇点,复杂度为O(n^4)以上,故有时会超时。本题用Stoer-Wagner 算法。...
分类:
其他好文 时间:
2014-05-09 15:23:18
阅读次数:
228
Crossing River
Time Limit: 1000MS
Memory Limit: 10000K
Total Submissions: 10218
Accepted: 3859
Description
A group of N people wishes to go across a river with only...
分类:
其他好文 时间:
2014-05-09 14:51:43
阅读次数:
257
A Funny GameTime Limit:1000MSMemory
Limit:65536KTotal Submissions:3861Accepted:2311DescriptionAlice and Bob decide
to play a funny game. At the beginn...
分类:
其他好文 时间:
2014-05-09 12:53:42
阅读次数:
265
戳我去解题Given amxnmatrix, if an element is 0, set its
entire row and column to 0. Do it in
place.这题还是很简单的,就是有点坑,遍历矩阵的时候,每遇到0的时候,我们不能立即将所在行和列置0,否则,到最后矩阵所有...
分类:
其他好文 时间:
2014-05-09 08:51:57
阅读次数:
253
戳我去解题Write an efficient algorithm that searches for
a value in anmxnmatrix. This matrix has the following properties:Integers in
each row are sorted f...
分类:
其他好文 时间:
2014-05-09 08:27:24
阅读次数:
241
// Matrix.h#ifndef MATRIX_H#define
MATRIX_H#include#include#include#define rows 4#define cols 4#define L 6using
std::ostream;classMatrix{friend ostrea...
分类:
其他好文 时间:
2014-05-09 07:21:22
阅读次数:
353
Pie
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 9653
Accepted: 3478
Special Judge
Description
My birthday is coming up and traditionally I'm serv...
分类:
其他好文 时间:
2014-05-09 06:33:22
阅读次数:
343
Ultimate Weapon
Time Limit: 2000MS
Memory Limit: 131072K
Total Submissions: 2007
Accepted: 958
Description
In year 2008 of the Cosmic Calendar, the Aliens send a hu...
分类:
其他好文 时间:
2014-05-09 06:28:01
阅读次数:
411
1 /* 2 题意:国际象棋起点到终点移动的最少步数 3 4
题解:水题,BFS就过了,有人用双向BFS 5 */ 6 #include 7 #include 8 #include 9 10 using namespace
std;11 12 int dir[8][2]={-2,1,-1,...
分类:
其他好文 时间:
2014-05-09 05:34:20
阅读次数:
387
Musical Theme
Time Limit: 1000MS
Memory Limit: 30000K
Total Submissions: 17298
Accepted: 5939
Description
A musical melody is represented as a sequence of N (1<=N<=20...
分类:
其他好文 时间:
2014-05-09 02:46:57
阅读次数:
375