
树的直径
console.log( )
吾日三省吾身:这事能不能不干、这事能不能推给别人干、这事能不能明天干。
展开
-
Farthest Nodes in a Tree
DescriptionGiven a tree (a connected graph with no cycles), you have to find the farthest nodes in the tree. The edges of the tree are weighted and undirected. That means you have to find two node原创 2016-08-02 21:53:14 · 347 阅读 · 0 评论 -
<hdoj4607>Park Visit
DescriptionClaire and her little friend, ykwd, are travelling in Shevchenko's Park! The park is beautiful - but large, indeed. N feature spots in the park are connected by exactly (N-1) undirected原创 2016-08-02 22:07:20 · 337 阅读 · 0 评论 -
<hdoj4514>湫湫系列故事——设计风景线
Description 随着杭州西湖的知名度的进一步提升,园林规划专家湫湫希望设计出一条新的经典观光线路,根据老板马小腾的指示,新的风景线最好能建成环形,如果没有条件建成环形,那就建的越长越好。 现在已经勘探确定了n个位置可以用来建设,在它们之间也勘探确定了m条可以设计的路线以及他们的长度。请问是否能够建成环形的风景线?如果不能,风景线最长能够达到多少? 其中,可以兴建的原创 2016-08-02 21:58:33 · 481 阅读 · 0 评论 -
<hdoj2196>Computer
DescriptionA school bought the first computer some time ago(so this computer's id is 1). During the recent years the school bought N-1 new computers. Each new computer was connected to one of sett原创 2016-08-02 21:51:23 · 712 阅读 · 1 评论 -
<poj2631>Roads in the North
DescriptionBuilding and maintaining roads among communities in the far North is an expensive business. With this in mind, the roads are build such that there is only one route from a village to a原创 2016-08-02 21:34:14 · 297 阅读 · 0 评论 -
<poj1985>Cow Marathon
DescriptionAfter hearing about the epidemic of obesity in the USA, Farmer John wants his cows to get more exercise, so he has committed to create a bovine marathon for his cows to run. The maratho原创 2016-08-02 21:32:18 · 314 阅读 · 0 评论 -
poj1383:Labyrinth
DescriptionThe northern part of the Pyramid contains a very large and complicated labyrinth. The labyrinth is divided into square blocks, each of them either filled by rock, or free. There is also原创 2016-08-02 21:41:08 · 446 阅读 · 0 评论