Путівки#6

Путівки (Обговорення)

  1. Andremaxico19 січ. 2025 р., 11:41

    How can it be 232 max if it can be 262 and 247?

    1. Viacheslav_Shevcenko16 лют. 2025 р., 15:06

      Andremaxico How did you manage to get such results? Maybe you misunderstood the problem. Here are a few possible outcomes in the example:

      • Selling first, second, third, then fourth ticket respectively: max(2 - 0, 0) * 37 + max(3 - 1, 0) * 45 + max(1 - 2, 0) * 46 + max(4 - 3, 0) * 30 = 194

      • Selling fourth, third, second, then first ticket respectively:max(4 - 0, 0) * 30 + max(1 - 1, 0) * 46 + max(3 - 2, 0) * 45 + max(2 - 3, 0) * 37 = 165

      • Selling second, first, fourth, then third ticket respectively(the maximum possible result):max(3 - 0, 0) * 45 + max(2 - 1, 0) * 37 + max(4 - 2, 0) * 30 + max(1 - 3, 0) * 46 = 232

  2. ilkinimanov9 лист. 2024 р., 18:23

    How can I implement dynamic programming algorithm on this question? There is dynamic programming tag in this question

    1. objective_tesla_95612 січ. 2025 р., 07:25

      ilkinimanov You are asking for the answer

      The problem is interesting for this part how to make connectivity between numbers and implement it in dynamic programming.