MarioYC's blog

By MarioYC, 13 years ago, In English

Hi everyone, could someone help me find my mistake in this problem. Basically what I do is improve the obvious DP approach (with state : position, last color, and how many consecutives carpets were equal) by considering only important indexes in the interval [1,L] (these are 1,L,all s_i, and all e_i + 1).

Code: http://pastebin.com/X2uYYFNH

Tags uva, dp
  • Vote: I like it
  • +8
  • Vote: I do not like it