pivot_columns

(256000 kilobytes, 1000 milliseconds)

Submissions: 0 · Accepted: 0

Submit code

Statement

Pivot columns

Work over \(\mathbb F_p\), where \(p=1\,000\,000\,007\).

Given an \(n\times m\) matrix \(A\), find the pivot columns produced by
Gaussian elimination from left to right. Columns are numbered from \(0\).

Input

The first line contains \(n\) and \(m\). The next \(n\) lines contain \(A\).

Output

Print the number \(r\) of pivot columns, followed by their indices in strictly
increasing order. The indices must be the pivot columns of the RREF of \(A\).

Constraints