Skip to content

Commit 3e0a362

Browse files
committed
fix north_east_lattice_paths.hpp
1 parent fa1774c commit 3e0a362

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

other_algorithms/north_east_lattice_paths.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ NorthEastLatticePathsBothBounded(const std::vector<int> &lb, const std::vector<i
171171
for (int i = 1; i < n; ++i) {
172172
assert(lb[i - 1] <= lb[i]);
173173
assert(ub[i - 1] <= ub[i]);
174+
if (ub[i - 1] <= lb[i]) return std::vector<MODINT>(ub.back() - lb.back());
174175
}
175176

176177
for (int i = 0; i < n; ++i) {

0 commit comments

Comments
 (0)