펭로그

1753 본문

Study/PS(Algorithm)

1753

노랑펭귄 2018. 8. 1. 10:41

// BOJ 1753 최단경로

#include <iostream>

#include <vector>

#include <queue>

#include <functional>

using namespace std;


struct edge {

vector<int> to;

vector<int> len;

};


int main() {

ios_base::sync_with_stdio(false);

cin.tie(NULL);

cout.tie(NULL);

freopen("input.txt", "r", stdin);


vector<edge> edg(20001);

priority_queue<int, pair<int, int>, greater<int> > qq;


int D[20001] = { -1, };

int num, e, start;

cin >> num >> e >> start;

D[start] = 0;

qq.push(pair<int, int>(0, start));


int u, v, w;

for (int i = 0; i < e; i++) {

cin >> u >> v >> w;

edg[u].to.push_back(v);

edg[u].len.push_back(w);

}


pair<int, int> tmp;

while (!qq.empty()) {

tmp = qq.top();

qq.pop();


int cost = tmp.first;

int node = tmp.second;

}


return 0;

}


다익스트라

Comments