Skip to content

Commit c982204

Browse files
committed
Rename a variable to avoid confusion
1 parent a595e8d commit c982204

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

atcoder/mincostflow.hpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ template <class Cap, class Cost> struct mcf_graph {
122122
return true;
123123
};
124124
Cap flow = 0;
125-
Cost cost = 0, prev_cost = -1;
125+
Cost cost = 0, prev_cost_per_flow = -1;
126126
std::vector<std::pair<Cap, Cost>> result;
127127
result.push_back({flow, cost});
128128
while (flow < flow_limit) {
@@ -139,11 +139,11 @@ template <class Cap, class Cost> struct mcf_graph {
139139
Cost d = -dual[s];
140140
flow += c;
141141
cost += c * d;
142-
if (prev_cost == d) {
142+
if (prev_cost_per_flow == d) {
143143
result.pop_back();
144144
}
145145
result.push_back({flow, cost});
146-
prev_cost = d;
146+
prev_cost_per_flow = d;
147147
}
148148
return result;
149149
}

0 commit comments

Comments
 (0)