#include #include #include #include #define INF 0x3f3f3f3f using namespace std; const int MAXN = 105; const int MAXM = 1005; int F1[MAXN],F2[MAXN]; priority_queue, greater > q1,q2; int n,m; struct Edge{ int u,v,w; bool used; int col; }edge1[MAXM],edge2[MAXM]; int tot1,tot2; void addedge1(int u,int v,int w,int col) { edge1[tot1].used = false; edge1[tot1].col = col; edge1[tot1].u = u; edge1[tot1].v = v; edge1[tot1++].w = w; } void addedge2(int u,int v,int w,int col) { edge2[tot2].used = false; edge2[tot2].col = col; edge2[tot2].u = u; edge2[tot2].v = v; edge2[tot2++].w = w; } bool cmp(Edge a,Edge b) { return a.w