https://www.luogu.com.cn/problem/CF2B
题目描述
There is a square matrix n×nn×n , consisting of non-negative integer numbers. You should find such a way on it that
- starts in the upper left cell of the matrix;
- each following cell is to the right or down from the current cell;
- the way ends in the bottom right cell.
Moreover, if we multiply together all the numbers along the way, the result should be the least "round". In other words, it should end in the least possible number of zeros.
输入格式
The first line contains an integer number nn ( 2<=n<=10002<=n<=1000 ), nn is the size of the matrix. Then follow nn lines containing the matrix elements (non-negative integer numbers not exceeding 10^{9}109 ).
输出格式
In the first line print the least number of trailing zeros. In the second line print the correspondent way itself.
有一个n*n的方阵,包含的都是非负数。你需要找到这样一个路径:
1.在方阵的左上角开始
2.接下来的方格在当前方格的下边或右边
3.这个路径在方阵的右下角结束
如果把路径上的数相乘,结果应该是最小"round"。换句话说,应该以最少0的数目结束。
输入第一行包含一个整数n,n是方阵的大小。接下来n行包含这个方阵的元素每个元素是不超过10^9的非负整数。
第一行输出最少为0的个数,第二行输出路径的方式。