1.20 The least round way 最不圆的方式

https://acs.jxnu.edu.cn/problem/CF2Bicon-default.png?t=M0H8https://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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值