최단경로알고리즘

    [다익스트라] (백준 5972) 택배 배송

    알고리즘 다익스트라 [문제 본문] 더보기 HTML 삽입 미리보기할 수 없는 소스 [푼 코드] #include #include #include #define MAXNUM 50001 #define INF 987654321 using namespace std; int N, M; vector v[MAXNUM]; int d[MAXNUM]; int Solved(int start, int end) { priority_queue pq; d[start] = 0; pq.push({ 0,start }); while (!pq.empty()) { int cost = -pq.top().first; int cur = pq.top().second; pq.pop(); for (auto iter = v[cur].begin(); iter..