Explain the problem

Правка en1, от plehem, 2018-03-24 14:08:18

Problem

I might have misunderstood the problem. Please explain the following case

3 12 2
5 9 1

Author's code output: 30, but there are 48 non-decreasing subsequences, e.g.

5 9 1  5 9 1  5 9 1   5 9 1  --> b
1 2 3  4 5 6  7 8 9  10 11 12 --> positions

length 1 subsequence 12
length 2: 
1-4,1-5,1-7,1-8,1-10,1-11,2-5,2-8,2-11,3-4,3-5,3-6,3-7,3-8,3-9,3-10,3-11,3-12,
4-7,4-8,4-10,4-11,5-8,5-11,6-7,6-8,6-9,6-10,6-11,6-12
7-10,7-11,8-11,9-10,9-11,9-12

total 36+12 = 48

What's wrong here?

Теги dynamic programming

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en11 Английский plehem 2018-03-26 12:46:01 3 Tiny change: ' 48 but it's 30:\n\n~' -> ' 48 but it is 30:\n\n~'
en10 Английский plehem 2018-03-26 10:32:57 31 Tiny change: 'preciated!\n\nSorry, for my poor English.' -> 'preciated!'
en9 Английский plehem 2018-03-26 02:48:20 5 Tiny change: 'y, for my English.' -> 'y, for my poor English.'
en8 Английский plehem 2018-03-25 23:42:40 2 Tiny change: 'already>\nSince, I' -> 'already>\n\nSince, I'
en7 Английский plehem 2018-03-25 23:41:55 23 Tiny change: 'eryone! \n\nSince, I' -> 'eryone! \n<fucking reply already>\nSince, I'
en6 Английский plehem 2018-03-25 21:08:28 4 Tiny change: 'weak at **dp** tagged ' -> 'weak at **DP** tagged '
en5 Английский plehem 2018-03-25 19:53:01 12
en4 Английский plehem 2018-03-25 19:50:16 411 Tiny change: ' [problem:588D]. I found' -> ' [problem:<b>588D<b>]. I found'
en3 Английский plehem 2018-03-24 20:31:19 2 Tiny change: '[Problem](http://c' -> '[Problem D](http://c'
en2 Английский plehem 2018-03-24 17:43:38 4 Tiny change: 'problem/587/B)\n\nI mig' -> 'problem/588/D)\n\nI mig'
en1 Английский plehem 2018-03-24 14:08:18 614 Initial revision (published)