#include typedef long long ll; typedef unsigned long long ull; #define FOR(i,a,b) for(int (i)=(a);i<(b);i++) #define REP(i,n) FOR(i,0,n) #define RANGE(vec) (vec).begin(),(vec).end() using namespace std; class LexicographicOrderShortestPath { public: void solve(void) { int N,M,S,G; cin>>N>>M>>S>>G; const int inf = 1<<30; vector> cost(N,vector(N,0)); vector> dist(N,vector(N,inf)); REP(i,N) dist[i][i] = 0; REP(i,M) { int a,b,c; cin>>a>>b>>c; dist[a][b] = dist[b][a] = c; cost[a][b] = cost[b][a] = c; } REP(k,N) REP(i,N) REP(j,N) dist[i][j] = min(dist[i][j], dist[i][k] + dist[k][j]); int c = S; cout< 0) { c = i; if (c == G) cout<solve(); delete obj; return 0; } #endif