2013年4月13日
摘要: 1 #include 2 #include 3 struct Edge 4 { 5 int u,v,w; 6 }edge[10010]; 7 int n,m,sett[110]; 8 int cmp(const struct Edge x,const struct Edge y) 9 {10 return x.w < y.w;11 }12 int ffind(int x)13 {14 if(x != sett[x])15 x = ffind(sett[x]);16 return x;17 }18 int kruskal()19 {20 ... 阅读全文
posted @ 2013-04-13 21:15 straw_berry 阅读(193) 评论(0) 推荐(0) 编辑
摘要: 【DescriptionDescription】We know that if a phone number A is another phone number B’s prefix, B is not able tobe called. For an example, A is 123 while B is 12345, after pressing 123, we call A, and notable to call B.Given N phone numbers, your task is to find whether there exits two numbers A and Bt 阅读全文
posted @ 2013-04-13 19:39 straw_berry 阅读(385) 评论(0) 推荐(0) 编辑