Help in atcoder GC problem(b) colorful slimes

Revision en2, by atlasworld, 2019-03-18 19:42:26

IN the problem colorful slimes you have to pick all color in minimum moves ,

Its mentioned in the editorial for a particular color i we need

min{a[i] , a[i-1] , ... , a[i-k]} . i dont understand how author uses this condition . and should we iterate for each k and then each i or for each i and the each k . how to deal with cycles , that is when we reach last index , how to relate it with first.

Can anyone who solved this problem , share approach .

> < > < >

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English atlasworld 2019-03-18 19:42:26 5 Tiny change: 'oach .\n\n> > >\n\n' -> 'oach .\n\n > < > < >\n\n'
en1 English atlasworld 2019-03-18 19:41:13 636 Initial revision (published)