摘要:
DescriptionDearboy, a goods victualer, now comes to a big problem, and he needs your help. In his sale area there are N shopkeepers (marked from 1 to N) which stocks goods from him.Dearboy has M supply places (marked from 1 to M), each provides K different kinds of goods (marked from 1 to K). Once s 阅读全文
摘要:
http://acm.sdut.edu.cn:8080/vjudge/contest/view.action?cid=50#problem/D最小生成树模板,注意的是这里有k个发电站,它们不再需要连接其他的发电站,所以任何两个发电站之间的权值是0; 1 #include 2 #include 3 const int maxn = 110; 4 const int INF = 0x3f3f3f3f; 5 int map[maxn][maxn],power[maxn]; 6 int n,k; 7 8 void prim() 9 {10 int dis[maxn],vis[maxn];11... 阅读全文