https://acs.jxnu.edu.cn/problem/CF2B
https://acs.jxnu.edu.cn/problem/CF2B
描述:
There is a square matrix n × n, consisting of non-negative integer numbers. You should find such a way on it that
有一个方形的矩阵n*n,由非负整数组成。你需要找到以下方式
- 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.
此外,如果我们将一路上的数相乘,结果应该是最不圆的。换句话说,他应该以最少的0结束。
输入:
The first line contains an integer number n (2 ≤ n ≤ 1000), n is the size of the matrix. Then follow n lines containing the matrix elements (non-negative integer numbers not exceeding 10^9).
第一行包括一个整数,表示该矩阵的大小。接下来n行包括矩阵的元素(非负整数且不超过10^9)
输出:
In the first line print the least number of trailing zeros. In the second line print the correspondent way itself.
第一行输出至少所需的0的个数。在第2行输出这种方式。
样例输入:
3 1 2 3 4 5 6 7 8 9
样例输出:
0 DDRR