10 2014 档案
摘要:【功能】Tarjan算法的用途之一是,求一个有向图G=(V,E)里极大强连通分量。强连通分量是指有向图G里顶点间能互相到达的子图。而如果一个强连通分量已经没有被其它强通分量完全包含的话,那么这个强连通分量就是极大强连通分量。【算法思想】用dfs遍历G中的每个顶点,通dfn[i]表示dfs时达到顶点i...
阅读全文
摘要:Largest Rectangle in a HistogramTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 11706Accepted Subm...
阅读全文
摘要:#include #include #include #include #include #include #include using namespace std;long long num[1000005];long long fz[1000005];long long xds[1000005]...
阅读全文
摘要:#include #include #include #include #include using namespace std;struct node{ int f, s;};vectorimap[40005];int deep[40005];int dis[40005];int fa[40005...
阅读全文
摘要:D. The Child and Sequencetime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputAt the children's day, ...
阅读全文
摘要:Mad scientist Mike has constructed a rooted tree, which consists ofn vertices. Each vertex is a reservoir which can be either empty or filled with wat...
阅读全文
摘要:#include #include#include#include#includeusing namespace std; int g[505][505]; int dx[505],dy[505];bool vx[505], vy[505];int dis[505]; int n, x, y;...
阅读全文
摘要:#include #include#include#includeconst int maxn = 301;const int INF = (1 t) slack[y] = t; } return false; }int KM() ...
阅读全文
摘要:#include#includeusing namespace std;bool map[505][505];int n, k;bool vis[505];int linker[505];void sscanf(){ int x, y; scanf("%d%d",&n,&k); for(int i=...
阅读全文
摘要:#include #include using namespace std; #define DIGIT 4 //四位隔开,即万进制 #define DEPTH 10000 //万进制 #define MAX 2251...
阅读全文
摘要:Beautiful PeopleTime Limit:10000/5000MS (Java/Others)Memory Limit:128000/64000KB (Java/Others) Special JudgeSubmitStatusProblem Description The most...
阅读全文