题意:有n个据点,np个发电机,nc个用户,m条电线,给出发电机,用户,电线的电流限制,求最大网络电流。
这是带节点的网络流,其实和原来没什么区别,只要在前后都增加一个据点,在这里我加了0和n+1两个节点,而发电机节点的电流限制可以
转化为0->节点的电流限制,用户节点电流的限制可以转化为节点->n+1的电流限制,之后套用最大网络流模板即可,这里我写了,Edmonds_karp算法。
稍后传...
分类:
Web程序 时间:
2014-07-12 23:35:08
阅读次数:
277
用tarjan解hdu2586,稍微谈了这个算法的实现,欢迎讨论...
分类:
其他好文 时间:
2014-07-12 22:09:04
阅读次数:
178
Given a linked list, swap every two adjacent nodes and return its head.
For example,
Given 1->2->3->4, you should return the list as 2->1->4->3.
Your algorithm should use only constant space. Y...
分类:
其他好文 时间:
2014-07-12 20:39:17
阅读次数:
225
基础1、说明:创建数据库CREATE DATABASE database-name 2、说明:删除数据库drop database dbname3、说明:备份sql server--- 创建 备份数据的 deviceUSE masterEXEC sp_addumpdevice 'disk', 'testBack', 'c:\mssql7backup\MyNwind_1.dat'--- 开始 备份B...
分类:
数据库 时间:
2014-07-12 19:56:29
阅读次数:
297
USER: Kevin Samuel [kevin_s1]
TASK: comehome
LANG: C++
Compiling...
Compile: OK
Executing...
Test 1: TEST OK [0.003 secs, 3376 KB]
Test 2: TEST OK [0.005 secs, 3376 KB]
Test 3: TEST OK [0.0...
分类:
其他好文 时间:
2014-07-12 19:26:53
阅读次数:
184
组合设计模式,就是可以把多个类组合在一个大类中,形成一个树形结构。
#include
#include
#include
using namespace std;
class Coporate
{
protected:
string name;
set coporate;
public:
explicit Coporate(string n = "", string d...
分类:
其他好文 时间:
2014-07-12 19:12:55
阅读次数:
156
MIME类型
MIME类型就是设定某种扩展名的文件用一种应用程序来打开的方式类型。当改扩展名的文件被访问的时候,浏览器会自动使用指定的应用程序来打开。
控制面板--管理工具--Internet信息服务(IIS)管理--网站--default--MIME类型--添加
. Application/*-director 无扩展名文件
.* application/*-directo...
分类:
其他好文 时间:
2014-07-12 17:08:39
阅读次数:
218
#include #include #include #include using namespace std;char map[110][110];int n,m;#define inf 100000struct node{ int x,y;};vector nn;int main(){ ...
不记得在哪搞了个数学公式生成的图形.vertices = 1000t = from 0 to (2*PI)r = 2.0x = r*(5*cos(t) - cos(6*t))y = r*(3*sin(t) - sin(4*t))给线加上一维变量的变化,使之变成面:vertices = D1:360 ...
分类:
其他好文 时间:
2014-07-12 14:31:10
阅读次数:
214