백준 1753 c++ 최단경로


백준 1753 c++ 최단경로

#include #include #include #include #include using namespace std; #define INF 1000000 int v, e; //정점, 간선 int start; //시작정점 int t1, t2, t3; int result[20001]; //최단경로값 저장할 배열 vectormap[300001]; void func(int s) { priority_queueq; //우선순위큐, 내림차순으로 선언, 가중치가 작은 순으로 정렬 q.push({ 0,s }); result[s] = 0; //시작점은 0 while (!q.empty()) { int num = q.top().second; // 1 2 3 4 int len = q.top().first; //0 2 3 7 q..


원문링크 : 백준 1753 c++ 최단경로