码迷,mamicode.com
首页 >  
搜索关键字:dis packet-drop    ( 1371个结果
Hopcroft-Karp算法模版
#include #include #include #include #include #include using namespace std;const int maxn = 3010;const int INF = 1 G[maxn];int dis;int n, m;bool vis[ma...
分类:其他好文   时间:2014-07-11 20:24:32    阅读次数:256
shu_1078 vijos_1091(环城旅行)_单调队列
http://202.121.199.212/JudgeOnline/problem.php?cid=1078&pid=9     分析:                  a[ i ] :  第i个城市的汽油与到下一个城市距离的差;                dis[ i ] : 第i个城市到下一个城市的距离;                s[ i ] : 前i个 a[ i...
分类:其他好文   时间:2014-07-11 00:20:56    阅读次数:377
poj 3463 Sightseeing (dij 求最短路和次短路并计数)
dijkstra求最短路和次短路的求法和计算  模板 dijkstra求最短路的变形。 外循环要循环2*n-1次,因为dis[n][2]有2*n个状态,而dis[s][0]已经用过一次。 算法: 1、如果比最短路短就更新最短路和次短路。 2、如果和最短路相等,更新最短路的计数。 3、如果和次短路相等,更新次短路的方法数。 4、如果比次短路短,更新次短路。 #...
分类:其他好文   时间:2014-07-09 12:41:26    阅读次数:205
HDU 4856 Tunnels (最短路+状压DP)
题意:给你N*N的网格,‘.’表示可以走,‘#’表示不能走,m条管道,每条管道有起点和终点坐标, Bob每次可以走到相邻的网格花费1s,问Bob走完m条管道要花多少时间;Bob在管道内不计算时间 即计算Bob从管道 i 的出口走到管道 j 的入口的时间Dis(e[i],s[j])的最小和,起点可以任意; 思路:看了题解说是状态压缩DP然后深入理解了下。 首先...
分类:其他好文   时间:2014-07-09 10:14:02    阅读次数:234
外接圆模板
double dis(Point a){ return a.x*a.x+a.y*a.y;}struct Circle Circumcircle(){ Circle tmp; double a,b,c,c1,c2; double xa,ya,xb,yb,xc,yc; a ...
分类:其他好文   时间:2014-07-06 17:39:21    阅读次数:153
DataInputStream(二进制输入流)和DataOutputStream二进制输出流(注意:in是从本地文件输入到程序中,out是从程序输出到本地种)
//切记以数据类型输出就以什么数据类型读入,//例如:dos.writeInt(100);写入,读取:dis.readUTF()有时会出现意想不到的错误,所以要时刻记得以数据类型输出就以什么数据类型读入//DataInputStream(二进制输入流)public class DataInputSt...
分类:其他好文   时间:2014-07-06 16:58:46    阅读次数:166
Hopcroft-Karp算法模版
#include #include #include #include #include #include using namespace std; const int maxn = 3010; const int INF = 1<<28; int dx[maxn], dy[maxn]; int cx[maxn], cy[maxn]; vector G[maxn]; int dis;...
分类:其他好文   时间:2014-07-06 11:39:26    阅读次数:199
基于51单片机的12864驱动
/**************dis_12864.h***************/ #include #ifndef __DIS_12864_H__ #define __DIS_12864_H__ #define uchar unsigned char #define uint  unsigned int /*12864端口定义*/ #define LCD_data ...
分类:其他好文   时间:2014-07-06 10:58:45    阅读次数:129
二维凸包模板
double cross(Point a,Point b){ return a.x*b.y-a.y*b.x;}double mul(Point p0,Point p1,Point p2){ return cross(p1-p0,p2-p0);}double dis(Point a){ ...
分类:其他好文   时间:2014-07-03 20:28:07    阅读次数:195
POJ 1797 Heavy Transportation
类似于我上一篇解题报告。POJ 2253 Frogger。 也是最短路的变形,也可以当成生成树做。 2253 是求跳的路径中 权值最小的那一条。 而这道题1797 是求路径中 权值最大的那一条。 只需要把2253 中的dis[]初始赋INF,其他赋为0。然后dis[v] d是某一边的大小。u出发点,v是到达点。 程序基本和 2253 一样。 #include #include...
分类:其他好文   时间:2014-07-03 13:31:00    阅读次数:193
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!