#include #include #define inf 2000000000 using namespace std; ifstream fin ("prog.in"); ofstream fout ("prog.out"); struct q { int nod, c; }; vector< vector > a; vector d; vector t; vector sel; int n; void creare() { fin>>n; a.resize(n+1); int i; q x; while(fin>>i>>x.nod>>x.c) { a[i].push_back(x); } d.resize(n+1,inf); t.resize(n+1); sel.resize(n+1); } void dijkstra(int sur) { int i,j,k,nod; sel[sur]=1; for(i=0;ia[nod][j].c+d[nod]) { d[a[nod][j].nod]=a[nod][j].c+d[nod]; t[a[nod][j].nod]=nod; } } } void afisare(int nod) { int no=t[nod]; afisare(no); fout<