题目链接: http://dsalgo.openjudge.cn/graph/4/
AC代码
#include <iostream>
#include <queue>
using namespace std;
int N, n, w, PREV[27], stk[27], it_stk;
char c1[2], c2[2];
struct edge {
int u, v, w;
bool operator<(const edge another) const {
return w > another.w;
}
};
priority_queue<edg