- 博客(6)
- 收藏
- 关注
原创 最大流
▶ 问题 在一个有向图里,每个路径都有最大容量,通过这个图最多能运输多少货物。默认容量非负,且不能同时存在边(u,v)和(v,u)。 ▶ 基本思路 维护一个流网络,初始化为0,不断增加流的值。 维护一个残存网络(存储分配流后每条边剩余的容量),初始为最大容量。(在以下代码中,没有特别开一个数组存储残存网络,而是通过原容量减去流网络得到残存网络) 通过在残存网络里寻找增广
2015-12-26 18:44:40 2404 1
原创 [PTA] Shortest Path [3]
#include <stdio.h> #include <stdlib.h> typedef enum {false, true} bool; #define INFINITY 1000000 #define MaxVertexNum 10 /* maximum number of vertices */ typedef int Vertex; /* ver...
2015-12-26 15:48:31 2133
原创 [C大程] 研讨题 CAD
/* 点击按钮,选择不同状态 */ /* 选择状态下,左键移动物体 */ /* 选择状态下,右键改变大小 */ /* 选择状态下,先选中,再delete和backspace删除图形 */ /* 文字状态下,先点击一处作为起始点,可以左移、右移、del、backspace*/ #include "graphics.h" #include "extgraph.h" #include "genli
2015-12-22 17:26:42 4885 4
原创 [C大程]图形程序设计_3 随笔画
#include "graphics.h" #include "extgraph.h" #include "genlib.h" #include "simpio.h" #include "conio.h" #include #include #include #include #include #include #include #include #include #inclu
2015-12-21 23:58:35 9843 9
原创 [C大程] 图形程序设计_4 编写窗口输入程序
#include "graphics.h" #include "extgraph.h" #include "genlib.h" #include "simpio.h" #include "strlib.h" #include "conio.h" #include #include #include #include #include #include #include #inclu
2015-12-21 19:57:19 8164 4
原创 [PTA] hashing(hard)
#include<stdio.h> #include<stdlib.h> #include<queue> #define MAX 1000 using namespace std; struct node{ int x; int i; bool operator<(const node w)const{ return x>w.x; ...
2015-12-18 21:42:16 1473
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人