josiftepe

Untitled

Nov 28th, 2020
43
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.90 KB | None | 0 0
  1. #include <iostream>
  2. #include <cmath>
  3. #include <vector>
  4. #include <queue>
  5. using namespace std;
  6. typedef long long ll;
  7. const int maxn = 1e5 + 10;
  8. const int INF = 2e9 + 10;
  9. vector<pair<int, int>> graph[maxn]; // graph[i].first - node, graph[i].second - weight
  10. int n, m;
  11. struct node {
  12.     int idx, shorest_path_till_idx;
  13.    
  14. };
  15. int dijkstra(int S, int E) {
  16.     vector<bool> visited(n + 1, false);
  17.     vector<int> dist(n + 1, INF);
  18.     dist[S] = 0; // shortest distance from source to source = 0
  19.     return -1;
  20. }
  21. int main()
  22. {
  23.     ios_base::sync_with_stdio(false);
  24.     cin >> n >> m;
  25.     for(int i = 0; i < m; ++i) {
  26.         int a, b, c;
  27.         cin >> a >> b >> c;
  28.         graph[a].push_back(make_pair(b, c));
  29.         graph[b].push_back(make_pair(a, c));
  30.         //undirected graph
  31.     }
  32.     int start, end;
  33.     cin >> start >> end;
  34.     cout << dijkstra(start, end) << endl;
  35.     return 0;
  36. }
  37.  
Advertisement
Add Comment
Please, Sign In to add comment