File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change 11#pragma once
2+ #include < queue>
3+ #include < vector>
24
35template <typename T> struct BellmanFord {
46 private:
5- static constexpr T INF = numeric_limits<T>::max() / 2 - 1 ;
7+ static constexpr T INF = std:: numeric_limits<T>::max() / 2 - 1 ;
68
79 struct Edge {
810 int to;
911 T cost;
1012 };
1113
1214 int n;
13- vector<vector<Edge>> G;
14- vector<T> dist;
15+ std:: vector<std:: vector<Edge>> G;
16+ std:: vector<T> dist;
1517
1618 public:
1719 explicit BellmanFord (int n) : n(n), G(n), dist(n, INF) {}
@@ -52,8 +54,8 @@ template <typename T> struct BellmanFord {
5254 }
5355 // 負閉路をBFSで伝播させる
5456 void spread_neg_cycles () {
55- queue<int > q;
56- vector<bool > used (n, false );
57+ std:: queue<int > q;
58+ std:: vector<bool > used (n, false );
5759 for (int i = 0 ; i < n; ++i) {
5860 if (dist[i] == -INF) {
5961 used[i] = true ;
You can’t perform that action at this time.
0 commit comments