shunfurh 于 2017.09.06 00:12 提问

Matrix

Given an n*n matrix A, whose entries Ai,j are integer numbers ( 0 <= i < n, 0 <= j < n ). An operation SHIFT at row i ( 0 <= i < n ) will move the integers in the row one position right, and the rightmost integer will wrap around to the leftmost column.

You can do the SHIFT operation at arbitrary row, and as many times as you like. Your task is to minimize

Input

The input consists of several test cases. The first line of each test case contains an integer n. Each of the following n lines contains n integers, indicating the matrix A. The input is terminated by a single line with an integer -1. You may assume that 1 <= n <= 7 and |Ai,j| < 104.

Output

For each test case, print a line containing the minimum value of the maximum of column sums.

Sample Input

2
4 6
3 7
3
1 2 3
4 5 6
7 8 9
-1

Sample Output

11
15

1个回答

caozhy      2017.09.20 08:51

matrix calculus
matrix calculus matrix calculus matrix calculus
Android画图之Matrix剖析
Android画图之Matrix剖析Android画图之Matrix剖析Android画图之Matrix剖析Android画图之Matrix剖析Android画图之Matrix剖析Android画图之Matrix剖析Android画图之Matrix剖析
Matrix Algebra Useful for Statistics,2ed,2017 ed
Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed Matrix Algebra Useful for Statistics,2ed
C++ 矩阵简单的计算器
C++课程设计 + Matrix(int l:int, w:int, n:int*) + Matrix() + Matrix(jz :Matrix &) + setnum(l :int, w :int) :void + operator+(const jz: Matrix &): Matrix + operator-(const jz:Matrix &):Matrix + operator*(const jz :Matrix &): Matrix + zhuanzhi():Matrix + show():void + ~Matrix() <<static>> +getflag():int void getmn(int &m,int &n)

Matrix Calculation
Matrix Calculation Matrix Calculation
The Matrix Cookbook(译)
The Matrix Cookbook(译)The Matrix Cookbook译 1基础 1迹Trace 2行列式Determinant 3特例22矩阵 2导数Derivatives1基础∗∗∗A−1表示A的逆矩阵∗∗∗∗;AT表示A的转置;AH表示Hermitian矩阵(A的共轭转置矩阵A∗==A)∗∗∗(AB)−1=B−1A−1(ABC...)−1=...C−1B−1A−1(AT)−1=(A
Relative Orientation 与fundamental essential matrix

python matrix operation
NumPy是一个关于矩阵运算的库，熟悉Matlab的都应该清楚，这个库就是让Python能够进行矩阵话的操作，而不用去写循环操作。 下面对numpy中的操作进行总结。 numpy包含两种基本的数据类型：数组和矩阵。 数组(Arrays) >>> from numpy import * >>> a1=array([1,1,1]) #定义一个数组 >>> a2=array([2,2,2
Android Matrix 超级详解