#include
using namespace std;
#define INF 0x7ffffff
typedef pair P;
#define maxn 100000+10
struct edge
{
int to;
int cost;
edge(){}
edge(int to_, int cost_)
{
to = to_;
...
分类:
其他好文 时间:
2015-03-29 12:18:27
阅读次数:
130
#include
using namespace std;
#define maxn 100000+10
#define INF 0x7ffffff
typedef pair P;
struct edge
{
int to;
int cost;
edge(){}
edge(int to_, int cost_)
{
to = to_;
...
分类:
编程语言 时间:
2015-03-29 10:51:49
阅读次数:
188
先感谢刘哥,嘿嘿。笔记本电脑win8改win7:操作方法1:1、开机出现Logo时点击F1进入bios2、选择Restart—OS Optimized Defaults,修改成Disabled3、点击F9(Edge系列机型点击Fn+F9),选择Yes4、点击F10(Edge系列机型点击Fn+F10)...
分类:
移动开发 时间:
2015-03-21 15:33:59
阅读次数:
154
Floyd算法要点:每次增加第k个点,比较经过第k个点的路径和不经过第k个点的路径的大小Floyd 算法能够求出任意两个顶点的最短路径核心代码 ,用领结矩阵来表示图比较方便邻接矩阵Edge[N][N]Edge[i][j]=Edge[j][i]=-1;//初始化Edge[i][i]=0;For(int...
分类:
其他好文 时间:
2015-03-21 13:58:33
阅读次数:
157
题目链接:点击打开链接
题意:
给定n个点的树,任意拆掉一条边,得到2个子树,再用刚拆掉的边把这两个子树连起来。
得到新的树,这个树的权值为任意两个点间的距离和。
使得新的树权值最小。输出这个权值。
枚举拆掉的边(u,v)
得到2个以u为根的子树和以v为根的子树
计算每条边对答案的贡献,拆掉的边贡献就是siz[u]*siz[v]*edge[u,v].dis
剩下的就是计算如何连接2...
分类:
其他好文 时间:
2015-03-21 11:19:51
阅读次数:
209
There couple of edge cases need to remember:1. The result, absolute value of dividend and divisor. Otherwise, when the record goes out of boundary, th...
分类:
其他好文 时间:
2015-03-19 08:50:24
阅读次数:
125
相信使用HPProcurve系列交换机的朋友非常痛苦的一件事就是资料比较少,实施的案例也比较少。这里比较了一下Cisco和HP交换机关于生成树协议(SpaninngTree)的比较表格。建议在边缘端口(只连接客户端电脑或非管理型交换机)上启用bpdu-protection、admin-edge-port、loop-prote..
分类:
系统相关 时间:
2015-03-18 18:39:51
阅读次数:
2508
Linux显示计算次数的结果
youhaidong@youhaidong-ThinkPad-Edge-E545:~$ free -c
free:选项需要一个参数 -- c
Usage:
free [options]
Options:
-b, --bytes show output in bytes
-k, --kilo show output ...
分类:
系统相关 时间:
2015-03-17 23:42:19
阅读次数:
214
Linux显示内存统计最大和最小的详情
youhaidong@youhaidong-ThinkPad-Edge-E545:~$ free -l
total used free shared buffers cached
Mem: 3103064 1547152 1555912 74...
分类:
系统相关 时间:
2015-03-17 23:41:58
阅读次数:
220
Linux显示所有输出域自动缩小到最短三数字单元和显示单元的打印
youhaidong@youhaidong-ThinkPad-Edge-E545:~$ free -h
total used free shared buffers cached
Mem: 3.0G 1.4G ...
分类:
系统相关 时间:
2015-03-17 23:41:18
阅读次数:
209