How this problem is solved?

Revision en3, by mike_wasabi, 2019-05-29 12:20:27

I need help with a problem like this: Count the number of arrays of n elements in which each element of the array has the value of paragraph [1, M] so that there are the same K consecutive values. with n, M, K <= 1000000 For example: n = 3, M = 2, k = 2 The result will be 6 satisfying fields that are (1,1,1); (1,1,2); (1,2,2); (2,1,1); (2,2,1); (2,2,2)

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English mike_wasabi 2019-05-29 12:20:27 454
en2 English mike_wasabi 2019-05-29 09:59:42 87
en1 English mike_wasabi 2019-05-29 07:34:01 424 Initial revision (published)