Function monotone_minima

Source
pub fn monotone_minima<T, F>(n: usize, m: usize, a: F) -> Vec<(usize, T)>
where T: Ord + Clone, F: Fn(usize, usize) -> T,
Expand description

nm列の行列の各行の最小値の位置と値を求める。

ただし、$i$番目の行の最小値となる列の位置$a_i$について、$a_0 \le a_1 \le \dots \le a_{n-1}$、を満たしていること。

Time complexity $O(n + m \log n)$