백준 1916 최소비용구하기 [c++]


백준 1916 최소비용구하기 [c++]

#include #include #include #include #include using namespace std; //백준 1916 - 다익스트라 int n, m;//도시의개수, 버스의개수 int map[1001][1001];//이동 비용 저장 vectorv(1001); int start, des;//출발도시, 도착도시 int t1, t2, t3; int answer = 987654321;//결과 bool visited[1001][1001];//방문확인할 배열 typedef struct { int x;//현재도시위치 int num;//비용 }node; struct cmp { bool operator()(node n1, node n2) { return n1.num > n2.num;//작은값이 top을 ..


원문링크 : 백준 1916 최소비용구하기 [c++]