fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define ll long long int
  4. #define endl "\n"
  5.  
  6. struct Edge
  7. {
  8. ll node = -1;
  9. ll cost = LLONG_MAX;
  10. Edge(ll u, ll v, ll cost) : u(u), v(v), cost(cost) {}
  11. bool operator<(const Edge &e) const { return cost < e.cost; }
  12. };
  13.  
  14. int main()
  15. {
  16. ios_base::sync_with_stdio(false);
  17. cin.tie(nullptr);
  18. int t = 1;
  19. ll N, M, A;
  20. // cin >> t;
  21. while (t--)
  22. {
  23. cin >> N >> M;
  24. vector<Edge> graph[N + 1];
  25.  
  26. for (int i{}; i < M; i++)
  27. {
  28. ll u, v, c;
  29. cin >> u >> v >> c;
  30. graph[u].push_back({v, c});
  31. graph[v].push_back({u, c});
  32.  
  33. }
  34. }
  35. return 0;
  36. }
Success #stdin #stdout #stderr 0.33s 40712KB
stdin
Standard input is empty
stdout
Standard output is empty
stderr
Error: unexpected symbol in "using namespace"
Execution halted