#P2107. Spoj2832 Find The Determinant III

Spoj2832 Find The Determinant III

题目描述

Problem code: DETER3 Given a NxN matrix A, find the Determinant of A % P. 给出一个尺寸为N×N的整数方阵A(N≤200),要求求出|A|%P的值(即A的行列式的值除以P的余数)。方阵中的数与P均为32位有符号类型可容纳的整数

输入格式

The first line of every test case contains two integers , representing N (0 < N < 201) and P (0 < P < 1,000,000,001). The following N lines each contain N integers, the j-th number in i-th line represents A[i][j] (- 1,000,000,001 < A[i][j] < 1,000,000,001).

输出格式

For each test case, print a single line contains the answer.

3 4
-840419217 -895520213 -303215897
537496093 181887787 -957451145
-305184545 584351123 -257712188
2