D.P problem (The least round way).

Правка en3, от rr459595, 2018-06-13 09:46:55

Here is the link to the problem:- http://codeforces.net/problemset/problem/2/B

If we have input matrix(2 rows and 3 columns) as:-

2 3

3 4 5

5 1 5

If we take 1-indexing, then at cell (2,2), we have 2 choices to get 0 number of trailing zeroes. One is (3*4*1) or (3*5*1). But we if we take (3*4*1)=12, then at the end cell (2,3), minimum number of trailing zeroes will be 1(by path 3-4-1-5). If we take 15 at cell 2, minimum number of trailing zeroes at the end will be 0 by path (3-5-1-5).

How to decide which number should I pick at cell (2,2) so that it doesn't affect the future cell (2,3)?

Thanks.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский rr459595 2018-06-13 09:46:55 4
en2 Английский rr459595 2018-06-13 09:45:12 12
en1 Английский rr459595 2018-06-13 09:43:47 644 Initial revision (published)