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

Автор infinity_hsn, история, 4 дня назад, По-английски
input
1 3 7 19
2 3
2 5
4 4 4
output
12

In this problem, we have to find the minimum sum of burles Vasya will spend. According to this example, the output should be 12. Still, I think it is wrong because if we buy 5 tickets of the first type, he only has to pay 5 burles or the second way is to buy 2 tickets of the first type for the buses and the second type of ticket for the trolley, as they have the same number so they will be considered as 1. Therefore, we get 1*3 + 2*1 = 5. Can someone please tell me if am I right or I am missing something or the example is wrong?

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

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

So you think the example has been wrong for 11 years and nobody fixed it?

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

    Wow, has this example been wrong for 11 years? Maybe it was a secret test of patience. But honestly, the argument seems interesting. Can anyone confirm?

  • »
    »
    4 дня назад, # ^ |
    Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

    Yes, because if you apply your brain then you would know that the minimum number of burles is 5 and not 12 in example 1. You can take pen and paper and solve it by your self.

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

this example can't be wrong, I think in 11 years at least one person would have noticed that it is wrong

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

the first type of ticket only allows for 1 ride on 1 transport. So you need 19 tickets of first type and not 5 as you said.

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

    Bro the question says that the line third and fourth are bus numbers and not the number of busses.

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

You have to spend 2 burles for the first bus ($$$C_1 * 2$$$)

Take the unlimited number of rides for the second bus ($$$C_2 * 1$$$)

Take the unlimited number of rides for all the trolleys ($$$C_3 * 1$$$)

The result will be 12, you can see that this is the minimum possible cost

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

    Bro I agree with this but the question mentions that the output should be the minimum number of burles.

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

      I think you misunderstood the problem

      The numbers 2 5 and 3 3 3 are not the number of the bus or the trolley

      It is the number of how many times Vasya will take the $$$i_{th}$$$ bus or trolley

      • »
        »
        »
        »
        4 дня назад, # ^ |
        Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

        Bro then what is 2 3 In the second line

        • »
          »
          »
          »
          »
          4 дня назад, # ^ |
          Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

          This is the number of buses and trolleys respectively

          There are 2 buses and 3 trolleys

          Vasya will take the first bus 2 times and the second bus 5 times

          Vasya will take the first trolley 4 times, the second trolley 4 times and the third trolley 4 times

          I hope you got it now ^_^

          • »
            »
            »
            »
            »
            »
            4 дня назад, # ^ |
              Проголосовать: нравится +3 Проголосовать: не нравится

            You are right, but you typed 3 instead of 4.

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

            Thanks bro. And one more thing you can reply any moment but when I want to reply it says that "You can write no more than 1 comments in 10 minutes. Why?

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

              You're welcome

              I really don't know why is that happening, but I think it is a rating-related anti-spam technique