#include #include #include #include #include using namespace std; struct edge{int to,cost;}; struct data{ int pos,cost; bool operator>(const data &d)const{ return cost>d.cost; } }; const int INF=1e9+7; int n,m,s,g; vectorG[200]; int d[200]; set >S; void dfs(int pos,int cost,vectorway){ way.push_back(pos); if(pos==s){ reverse(way.begin(),way.end()); S.insert(way); return; } for(int i=0;i,greater >Q; Q.push((data){s,0}); while(Q.size()){ int pos=Q.top().pos,cost=Q.top().cost; Q.pop(); if(d[pos](0)); vectorans=*(S.begin()); for(int i=0;i