My code not working

Can u pls tell me what went wrong with my code

Mistake is in addEdge function

your addEdge function

void addEdge(ll u,ll v,ll cost)
{
    l[u].push_back(make_pair(u,cost));
    l[v].push_back(make_pair(v,cost));
}

correct way to do is

  void addEdge(ll u, ll v, ll cost)
    {
        l[u].push_back(make_pair(v, cost));
        l[v].push_back(make_pair(u, cost));
    }

Modified Code

if you have more doubts regarding this feel free to ask
i hope this helps
if yes hit a like :heart:: and don’t forgot to mark doubt as resolved :grinning: