随笔分类 - 图论
摘要:题目: 传送门 题意很简单就不解释了,水题一道。
阅读全文
摘要:题目链接:http://poj.org/problem?id=3281 PS:刷够网络流了,先这样吧,之后再刷,慢慢补。 题意:有F种食物,D种饮料,N头奶牛,只能吃某种食物和饮料(而且只能吃特定的一份),一种食物被一头牛吃了之后,其余牛就不能吃了 第一行有N,F,D三个整数:接着2-N+1行代表第
阅读全文
摘要:题目链接:http://poj.org/problem?id=1459 题意:有n个结点,np个发电站,nc个消费者,m个电力运输线。接下去是m条边的信息(u,v)cost,cost表示边(u,v)的最大流量;a个发电站的信息(u)cost,cost表示发电站u能提供的最大流量;b个用户的信息(v)
阅读全文
摘要:构造双连通图:一个有桥的连通图,如何把它通过加边变成边双连通图?一个有桥的连通图,如何把它通过加边变成边双连通图?方法为首先求出所有的桥,然后删除这些桥边,剩下的每个连通块都是一个双连通子图。把每个双连通子图收缩为一个顶点,再把桥边加回来,最后的这个图一定是一棵树,边连通度为1。统计出树中度为1的节...
阅读全文
摘要:题目:http://poj.org/problem?id=1523题目解析:注意题目输入输入,防止PE,题目就是求割点,并问割点将这个连通图分成了几个子图,算是模版题吧。#include #include #include #include #include #include #define N 1...
阅读全文
摘要:题目:http://poj.org/problem?id=1144求割点。判断一个点是否是割点有两种判断情况:如果u为割点,当且仅当满足下面的1条1、如果u为树根,那么u必须有多于1棵子树2、如果u不为树根,那么(u,v)为树枝边,当Low[v]>=DFN[u]时。然后根据这两句来找割点就可以了。模...
阅读全文
摘要:题目:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1588吐下槽,不得不说ZOJ好坑,模版题做了一个多小时。题意:* 给出一个无向图,输入n(表示n个定点,1~n), m(m条边,有重边),* (2 dfn[u](u,v)为树...
阅读全文
摘要:http://acm.sdut.edu.cn/sdutoj/showproblem.php?pid=2498&cid=1304 题目描述 一个无环的有向图称为无环图(Directed Acyclic Graph),简称DAG图。 AOE(Activity On Edge)网:顾名思义,用边表示活动的
阅读全文
摘要:题目: http://poj.org/problem?id=1236【题意】N(2#include #include #include #include #include #include #define N 1010using namespace std;struct node{ int x...
阅读全文
摘要:题目解析: 这题题意没什么好说的,解法也挺简单的,只要会tarjan算法+只有一个出度为0的强连通分量题目有解这题就迎刃而解了。#include #include #include #include #define N 100002using namespace std;int n,m,tt,tim...
阅读全文
摘要:#include #include #include #include #include #define inf 1000001 using namespace std; struct node { int x,y,c,w; int next; } eg[400001]; int n,m,K,s,t,tt,head[2005],dis[2005],pre[2005],v...
阅读全文
摘要:http://poj.org/problem?id=1175 题目解析: 这个题因为数据的原因可以很水的过,但我因为把1e-8写成了1e-9WA了N遍,一直WA,题目意思很简单就是相似图形(就是求旋转的图形,我不会,但在discuss中看到 可以通过求图形的长度来求)另外常识性问题double数据类
阅读全文
摘要:http://poj.org/problem?id=2135
阅读全文
摘要:http://poj.org/problem?id=2195
阅读全文
摘要:http://poj.org/problem?id=1273 Description Every time it rains on Farmer John's fields, a pond forms over Bessie's favorite clover patch. This means t
阅读全文
摘要:#include <iostream>#include <string.h>#include <stdlib.h>#include <stdio.h>#include <queue>#include<algorithm>#define inf 0x3f3f3f3fusing namespace st
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1010 //题目链接 http://ycool.com/post/ymsvd2s//一个很好理解剪枝思想的博客 http://blog.csdn.net/chyshnu/article/details/617175
阅读全文
摘要:http://poj.org/problem?id=3009 Description On Planet MM-21, after their Olympic games this year, curling is getting popular. But the rules are somewha
阅读全文
摘要:http://poj.org/problem?id=2488 Description Background The knight is getting bored of seeing the same black and white squares again and again and has d
阅读全文
摘要:http://poj.org/problem?id=1426 Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representat
阅读全文