E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
POJ1273
POJ1273
Drainage Ditches (SAP+GAP)
题目大意:每当下雨,农夫FJ最喜爱的养尊处优的地方周围就变成了一个池塘,这让他很不爽,所以决心要把这个问题解决掉,所以他就在四周建造了一些渠沟以便排水,更为巧妙地是可以把这水排到一个小溪处。编号为1的节点作为池塘,编号为n的地方作为小溪。求最大排水量思路:赤裸裸的最大流。SPA+GAP再次撸过~~~要注意的是可能最大流会超int。还有的是:如果是拿邻接矩阵做的话要考虑重边问题(包含自环),但是邻接
kg_second
·
2012-10-05 18:00
poj1273
- Drainage Ditches
想看更多的解题报告:http://blog.csdn.net/wangjian8006/article/details/7870410 转载请注明出处:http://blog.csdn.net/wangjian8006题目大意:有N条水沟,M个水池,问从第一个水池到最后一
wangjian8006
·
2012-08-30 15:00
最大流
poj1273
//BFS的Edmonds_Karp #include #include usingnamespacestd; constintN=210;//顶点最多个数 constintINF=0x7FFFFFFF;//无穷大 intn,m,map[N][N],path[N],flow[N],start,end;//n为顶点,m为边,map为邻接矩阵 queueq; intbfs(
liang5630
·
2012-08-12 16:00
c
input
Path
经典的最大流题
POJ1273
百度文库花了5分下的不过确实是自己需要的东西经典的最大流题
POJ1273
——其他练习题 POJ3436 、题意描述:现在有m个池塘(从1到m开始编号,1为源点,m为汇点),及n条水渠,给出这n条水渠所连接的池塘和所能流过的水量
huzhengnan
·
2012-07-20 11:00
算法
优化
百度
SAP
iostream
pair
网络流&费用流专辑
poj1273
DrainageDitches网络流第一大水,入门基础题。
kksleric
·
2012-04-05 20:00
c
网络
NetWork
Matrix
产品
Intervals
网络最大流问题
poj1273
Drainage Ditches
网络最大流问题。其实想法很直观,就是找一条流的路径,然后取这条路径上的最大流量,然后更新约束条件,然后再找这样的路径。。。直到没有能继续的路径。 找路径的方法使用的是广度优先搜索。 ps:最近在练习c语言,c语言虽然用起来比c++墨迹,各种注意事项,但是运行速度上跟c++的确不在一个量级上。15msAC,源代码:/* *======================================
mazheng1989
·
2011-12-07 10:00
poj1273
网络流的水题,只需注意两点:1.具有多重边,例如:32124125126输出是:152.测试数据有多组,且不是以输入N为0结束。//508K16ms #include #include usingnamespacestd; #defineINF0x7fffffff #defineSIZE205 intcap[SIZE][SIZE],flow[SIZE][SIZE]; intpre[SIZE],d
Non_Cease
·
2011-08-22 16:00
POJ1273
最大流模板题_Edmonds_Karp
赤果果的网络流...模板题...唯一要留意的是一条边可能会给出多次容量..所以每次都要加起来才是这条边的流量...用Edmonds_Karp写的:/*
POJ1273
最大流模板题.Edmonds_Karp
kk303
·
2011-08-22 10:00
网络
NetWork
poj1273
Drainage Ditches
基础的网络最大流。。。Edmonds-Karp算法飘过。。#include#includeusingnamespacestd;structnode{ intnum,value; };constintsize=210;intmapp[size][size];//原流量intresmapp[size][size];//残余流量intfather[size];boolvisited[
zhang360896270
·
2011-07-24 10:00
c
算法
网络
最大流(增广路-EK)
poj1273
DrainageDitchesTimeLimit: 1000MSMemoryLimit: 10000KTotalSubmissions: 31138Accepted: 11423DescriptionEverytimeitrainsonFarmerJohn'sfields,apondformsoverBessie'sfavoritecloverpatch.Thismeansthattheclove
xymscau
·
2011-07-12 21:00
Stream
Integer
input
each
output
Forms
POJ1273
Drainage Ditches(裸最大流,EK,DINIC)
注意重边。EK:#include #include #include #definemin(a,b)aQ; Q.push(1); min_flow[1]=INF; while(!Q.empty()){ u=Q.front(); Q.pop(); if(u==m)break; for(inti=2;i0){ pre[i]=u;//保存前驱,同时标记是否已访问 min_flow[i]=min(min_
l04205613
·
2011-03-03 21:00
c
struct
网络
POJ1273
(最大流)
#include//Edmonds-karp,timecomplexity:O(V*E*E)#includeusingnamespacestd;intINF;intmain(){ memset(&INF,127,4); constintmax=202; intflow[max][max]; inta[max]; intparents[max]; intcapacity[m
paul08colin
·
2011-01-04 10:00
网络流
poj1273
裸的网络流,但要注意这道题有重边。用白书上面的增广路写的。
mindmb
·
2010-09-15 10:00
网络
input
output
POJ1273
Drainage Ditches(网络流&增广路)
/*PKU1273DrainageDitches Edmonds-KarpMaximumFlow O(VE^2)*/#include#includeusingnamespacestd;constintN=210;intad[N][N],flow[N][N];intpre[N],inc[N];intn,m;boolBFS(intad[N][N],intsrc,intdes){ queueq;
Paradise_for_why
·
2010-08-13 13:00
网络
POJ 1273 最大流
POJ1273
最大流一、题目描述DescriptionEverytimeitrainsonFarmerJohn'sfields,apondformsoverBessie'sfavoritecloverpatch.Thismeansthatthecloveriscoveredbywaterforawhileandtakesquitealongtimetoregrow.Thus
Icyflame
·
2009-06-23 19:00
一大牛的 网络最大流 程序(POJ 1273 )
一大牛的网络最大流程序(
POJ1273
)和自己的比起来,感觉大牛的代码要精悍的多啊。
·
2007-03-28 18:00
上一页
1
2
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他