15
}
17 };
18
19
N boxes are arranged in a straight line on a table. Each box has an
integer label on it and also contains an integer value inside it. You are
also given two integers cost1 and cost2. The score of a sequence of
boxes is calculated as follows:
1. If there are no boxes on the table, then the score is 0. Otherwise,
the initial score is the product of cost1 and the integer contained
inside the first box from left.
2. For every box left on the table(traverse from left to right) except
the first box from the left, we add
a. The product of cost1 and the integer inside the current box to
the score, if the labels on the current box and the box present to
its left are different.
b. The product of cost and the integer inside the current box to
the score, if the labels on the current box and the box present to
its left are the same.
Geek wants to remove some boxes (possibly Zero or all) so that the
score is maximum possible.
Answers
Answered by
1
how long this question r.
this question is in probability
so answer is cost 1.cost2 × 0
that is 0
Similar questions