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

Автор pistone, 13 лет назад, По-английски

there are 10000 stations numbered from 0 to 9999. from each station , some load has to be transferred to another station by train . the fuel consumption of train between 2 successive station is 1 litre .

Find the minimum amount of fuel , in which loads can be transferred to all the destination stations.

constraints: the load for each station is between 1 and 100 inclusive. a train cannot carry more than 50 kgs of load at one time. a train cannot carry loads of several stations at the same time even if it can take more load . several stations can send their load to a station at the same time.

the first train leaves station 0.

Input : the destination station and load to be transferred for each of the 10000 stations.

need help in solving this problem

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

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

Please provide link to the problem, in the opposite case you can be cheater.

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

    hi , this was already asked in my company's internal programming contest. i couldnt solve it