Nule
We are given a game board consisting of squares arranged in N rows and N columns, with each square containing a single non-negative integer In the beginning of the game, a piece is situated on the top-left square (1,1) and it has to get to the bottom-right square (N,N) only moving one-square-down or one-square-to-the-right in each step. Furthermore, a piece can not be placed on a square containing number 0. We define the cost of a path to be the product of all the numbers on that path. We say that some path is optimal if number of zeros at the end of decimal representation of its cost is minimal. Write a program that will calculate the number of zeros at the end of the decimal representation of cost
of optimal path.
3
1 2 3
4 5 6
7 8 9 Output
0 Submit solution
Coming laterThe grading service will be connected in a later migration step. You can inspect the task and your previous results now.