摘要: Counting LeavesA family hierarchy is usually presented by a pedigree tree. Your job is to count those family members who have no child.InputEach input file contains one test case. Each case starts with a line containing 0 < N < 100, the number of nodes in a tree, and M (< N), the number of 阅读全文
posted @ 2013-03-24 23:18 冰点猎手 阅读(224) 评论(0) 推荐(0)
摘要: 方法一: dijstra + DFSView Code 1 #include <stdio.h> 2 #include <string.h> 3 4 const int INF = 10000000 ; 5 int map[505][505]; 6 int dist[505]; 7 int teamNum[505]; 8 int visit[505]; 9 int N , M, C1, C2; 10 int pathNum, maxTeamNum; 11 void initApp() 12 { 13 int temp, m, n, i, j; 14 me... 阅读全文
posted @ 2013-03-24 18:24 冰点猎手 阅读(280) 评论(0) 推荐(0)