#include using namespace std; struct edge { int to, w; } a[10001]; int dis[101]; int ans, cnt; vector graph[101]; bool visit[101]; struct cmp //·ΒΊ―Κύ { bool operator()(const edge &a, const edge &b) { return a.w > b.w; } }; priority_queue, cmp> pq; int main() { int n,m,k; cin>>n>>m; for (int j = 1; j <= m; j++) { int a,b,c; cin>>a>>b>>c; graph[a].push_back({b,c}); graph[b].push_back({a,c}); } for (int i = 1; i <= n; i++) { dis[i]=INT_MAX/2; } visit[1]=true; for(int i=0;i