题意:树上每个节点上有若干苹果,边上带权,问你最小费用使得书上的苹果方差最小。思路:上下费用流问题,参考http://blog.csdn.net/qq564690377/article/details/8870587代码如下:
1 /********************************....
分类:
其他好文 时间:
2014-05-16 21:50:35
阅读次数:
491
http://blog.youxu.info/2014/05/11/language-and-vm/导言编程语言的发展历史,总的来说,是一个从抽象机器操作逐步进化为抽象人的思维的过程。机器操作和人的思维如一枚硬币的两面,而语言编译器就像是个双面胶,将这两面粘在一起,保证编程语言源程序和机器代码在行为...
分类:
其他好文 时间:
2014-05-16 20:38:48
阅读次数:
437
linux 支持的语言列表配置文件
/usr/share/system-config-language/locale-list;系统配置工具基于图形及命令行文本格式
system-config-language;kickstart文件里的%packages 部分列出所支持的语言的支持软件包组;%p....
分类:
其他好文 时间:
2014-05-16 20:28:27
阅读次数:
272
zoj 3673 1 /** 2 6700417 3 **/ 4 #include 5
#include 6 #include 7 #include 8 #include 9 using namespace std;10 11 typedef
unsigned long long LL;12 13 ...
分类:
其他好文 时间:
2014-05-13 18:07:32
阅读次数:
234
Robert is clipping his fingernails. But the nail clipper is old and the edge of the nail clipper is potholed.
The nail clipper's edge is N millimeters wide. And we use N characters('.' or '*') to rep...
分类:
其他好文 时间:
2014-05-13 15:05:54
阅读次数:
264
Mahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word ma...
分类:
其他好文 时间:
2014-05-13 14:59:51
阅读次数:
356
1729 is the natural number following 1728 and preceding 1730. It is also known as the Hardy-Ramanujan number after a famous anecdote of the British mathematician G. H. Hardy regarding
a hospital vis...
分类:
其他好文 时间:
2014-05-13 14:52:34
阅读次数:
314
Mahjong is a game of skill, strategy and calculation and involves a certain degree of chance. In this problem, we concentrate on Japanese Mahjong, a variation of mahjong. For brief, all of the word ma...
分类:
其他好文 时间:
2014-05-13 13:54:14
阅读次数:
463
中心节点就是树的中心,2遍dfs求到树的直径,而中心一定在直径上,顺着直径找到中心就够了。
然后可以一遍树形DP找到最小值或者二分+判断是否访问到叶子节点。
#include
#include
#include
#include
using namespace std;
struct node
{
int next;
int power;
int length...
分类:
其他好文 时间:
2014-05-13 11:28:38
阅读次数:
306
思路:半夜了思路有点混乱wa了好几发。一开始坑定两个人距离为m才能获得最大的收益,所以我们就可以枚举单个端点,当距离达到m时在一同一个方向走这是我们只需要算一下剩下几秒,左右两边贪心去最大的即可。代码如下:
1 /*******************************************...
分类:
其他好文 时间:
2014-05-13 09:58:02
阅读次数:
268