Блог пользователя manvscode

Автор manvscode, история, 7 лет назад, По-английски

in the problem Saghher And Nubian Market i am getting an awkward error. I am able to output a more optimal answer, than jury, don't know how is itiwrong (in test case 6) link to my submission. please help, am a newbie. they dont have to be consecutive, but do they have to be in order?

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

If you are picking up three items then corresponding prices for the items would be

[4,3,2,1] =====>(Picking up 3 items)=====> [4+1*3,3+2*3,2+3*3,1+4*3]====>[7,9,11,13].

Your answer is 24 for 3 items. Which items would you pick to get 24 as an answer? Here the minimum you can get is 27 by picking up 7,9 and 11 so jury's answer is correct. You might have made some mistake in understanding the question statement.

»
7 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

You can't sort items. Item's price depends on the initial position. With sorting the problem is much easier