Luogu 2740 Code: #include <bits/stdc++.h> using namespace std; #define maxn 210 #define maxm 210 const int inf=1<<30; int n,m,s,t,head[maxm],size=1,vis[maxm]; struct egde { int v,w,nxt; }e[maxn<<1]; struct node { int vi,eg; }pre[maxn&
PIGS Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 15721 Accepted: 7021 Description Mirko works on a pig farm that consists of M locked pig-houses and Mirko can't unlock any pighouse because he doesn't have the keys. Customer
转自:https://blog.csdn.net/liangzhaoyang1/article/details/51602926 设G是所有边权均不相同的无向联通图。 证明一: 首先,易证图G中权值最小的边一定是最小生成树中的边。(否则最小生成树加上权值最小的边后构成一个环,去掉环中任意一条非此边则形成了另一个权值更小的生