Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- using namespace std;
- typedef long long ll;
- const int maxn = 1e5 + 10;
- const int INF = 2e9 + 10;
- vector<pair<int, int>> graph[maxn]; // graph[i].first - node, graph[i].second - weight
- int n, m;
- struct node {
- int idx, shorest_path_till_idx;
- };
- int dijkstra(int S, int E) {
- vector<bool> visited(n + 1, false);
- vector<int> dist(n + 1, INF);
- dist[S] = 0; // shortest distance from source to source = 0
- return -1;
- }
- int main()
- {
- ios_base::sync_with_stdio(false);
- cin >> n >> m;
- for(int i = 0; i < m; ++i) {
- int a, b, c;
- cin >> a >> b >> c;
- graph[a].push_back(make_pair(b, c));
- graph[b].push_back(make_pair(a, c));
- //undirected graph
- }
- int start, end;
- cin >> start >> end;
- cout << dijkstra(start, end) << endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment