Simple dijkstra's  implementation c++ smooth af !!
\n#define pb push_back\n#define F first\n#define S second\n#define pii pair<int,int>\n#define vi vector<int>\n#define vii vector<pii>\n#define vvi vector<vector
```\n#define pb push_back\n#define F first\n#define S second\n#define pii pair<int,int>\n#define vi vector<int>\n#define vii vector<pii>\n#define vvi vector<vector<int>>\n#define vvpii vector<vector<pair<int,int>>>\n#define vc vector\n\nclass Solution {\npublic:\n    int minCost(int maxTime, vector<vector<int>>& edges, vector<int>& pass) {\n        int n = pass.size();\n        vvpii g(n);\n        for(auto it : edges)\n        {\n            g[it[0]].pb({it[1],it[2]});\n            g[it[1]].pb({it[0],it[2]});\n        }\n        \n        priority_queue<vector<int>, vector<vector<int>>, greater<vector<int>>> pq;\n        pq.push({pass[0], 0, 0});\n        vector<int> time(n,maxTime + 1);\n        time[0] = 0;\n        \n        \n        while(!pq.empty())\n        {\n            int curr_cost = pq.top()[0];\n            int curr_node = pq.top()[1];\n            int curr_time = pq.top()[2];\n            pq.pop();\n            \n            if(curr_node == n-1) return curr_cost;\n            \n            for(auto [v,t] : g[curr_node])\n            {\n                int newTime = curr_time + t, newCost = curr_cost + pass[v];\n                if(newTime < time[v])\n                {\n                    time[v] = newTime;\n                    pq.push({newCost, v, newTime});\n                }\n            }\n        }\n        \n      return -1;\n    }\n};\n```
['C']