#include #include #include using namespace std; struct Info{ int from,to,cost,time; }; struct Dik{ int vertex; int cost,time; // bool operator<(const Dik &other)const{ // return cost>other.cost; // } }; int main(){ int N,current,ver; cin >> N >> current; cin >> ver; Info info[2500]; map dp; for(int i=0 ; i> info[i].from; dp[info[i].from]=1000000000; } for(int i=0 ; i> info[i].to; dp[info[i].to]=1000000000; } for(int i=0 ; i> info[i].cost; for(int i=0 ; i> info[i].time; queue circle; Dik now;now.vertex=1; now.cost=now.time=0; circle.push(now); int min=1000000000; while(circle.size()!=0){ now=circle.front();circle.pop(); if(now.cost>current)continue; if(now.vertex==N) if(min>now.time)min=now.time; Dik next; if(min