题意:求节点间的最大距离
先DFS一次 记录下 每一节点的子树下的最大距离(DP[ u ] [ 0 ])和第二大距离(DP[ u ] [ 1 ])
用DP[ v ] [ 2 ] 表示由v的父节点来的最大距离
再取DP[ u ] [ 0 ] 与 DP[ u ][ 2 ] 的最值
#include
#include
#include
#include
#include
#in...
分类:
其他好文 时间:
2014-10-04 12:51:06
阅读次数:
201
1443. Printer QueueConstraintsTime Limit: 1 secs, Memory Limit: 32 MBDescriptionThe only printer in the computer science students' union is experienci...
分类:
其他好文 时间:
2014-10-04 02:44:45
阅读次数:
264
localhttp://localhost/----.phphttp://127.0.0.1/----.phplocalorLANhttp://computername/----.phpInternetuserhttp://IPadress/----.phphttp://computerrealmname/----.php
分类:
Web程序 时间:
2014-10-03 01:40:04
阅读次数:
175
Ruby是一种面向对象编程语言,这意味着它操纵的编程结构称为"对象"先上代码, 了解类的定义与使用方式class Computer $manufacturer = "Mango Computer, Inc." @@files = {hello: "Hello, world!"} def i...
分类:
其他好文 时间:
2014-10-02 18:17:43
阅读次数:
154
Time Limit:1000MSMemory Limit:10000KTotal Submissions:11433Accepted:4551DescriptionA number of schools are connected to a computer network. Agreements...
分类:
Web程序 时间:
2014-10-01 20:20:41
阅读次数:
222
最近研究了下nova的流程。下面是流程图其中computer-api到computeManger之间的具体调用关系如下:computerl.manager之后的流程如下:
分类:
其他好文 时间:
2014-09-30 21:14:59
阅读次数:
199
1.singnedcharsignedchar/char/unsignedchar区别,主要在于char,char默认为是signed还是unsigned与具体的编译器有关,vc6.0默认为signed。2、可以在include文件里面的float.h中查看各种有关float的宏定义3、八进制0123、十六进制0x1234、enumcomputer{lianXiang;daiEr;hongJ..
分类:
其他好文 时间:
2014-09-29 04:17:37
阅读次数:
218
Protecting computer systems from attacks that attempt to change USB topology and for ensuring that the system's information regarding USB topology is ...
分类:
其他好文 时间:
2014-09-28 20:28:55
阅读次数:
212
问题描述:
Programming Assignment 3: Pattern Recognition
Write a program to recognize line patterns in a given set of points.
Computer vision involves analyzing patterns in visual images and recon...
分类:
其他好文 时间:
2014-09-28 17:10:03
阅读次数:
293
ACM Computer Factory
Time Limit: 1000MS
Memory Limit: 65536K
Total Submissions: 5412
Accepted: 1863
Special Judge
Description
As you know, all the computers use...
分类:
其他好文 时间:
2014-09-28 16:54:43
阅读次数:
599