Skip to content

Commit 56a6f71

Browse files
committed
Add assertions into mincostflow.rs
1 parent 419b128 commit 56a6f71

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/mincostflow.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,9 @@ where
5050
assert!(from < self.g.len());
5151
assert!(to < self.g.len());
5252
assert_ne!(from, to);
53+
assert!(cap >= T::zero());
54+
assert!(cost >= T::zero());
55+
5356
self.pos.push((from, self.g[from].len()));
5457
self.cost_sum += cost;
5558

0 commit comments

Comments
 (0)