From Evernote: uva 216 先使用最小生成樹試試看,發現這不能用分岔,所以只能用暴力剪枝 [sourcecode language="cpp"] //============================================================================ // Name : Getting in Line.cpp // Date : 2013 2013/1/31 下午6:50:29 // Author : GCA //============================================================================ #include <iostream> #include <cstdio> #include <cstring> #include <algorithm> #include <cmath> #include <climits> #include <vector> #include <set> #include <map> #include <queue> #include <cctype> #include <utility> using namespace std; typedef long long ll; typedef unsigned int uint; #define Set(a,s) memset(a,s,sizeof(a)) #define Write(w) freopen(w,"w",stdout) #define Read(r) freopen(r,"r",stdin) #define Pln() printf("\n") #define I_de(x,n)for(int i=0;i<n;i++)printf("%d ",x[i]);Pln() #define De(x)printf(#x"%d\n",x) #define For(i,x)for(in...