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

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

Can you please tell me where I am going wrong. The link to the question is: http://www.spoj.com/problems/MAKETREE/

Here is my solution:

http://ideone.com/8japCn

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

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

3 2

1 3

2 1 3

On this test your code gives wrong answer. It seems to "forget" about fact, that first student wanted to be a superior of third one.

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

    But he cant be the superior. Its giving output as 2 0 2. I am taking 2 as the main boss. Am I still going wrong? Can you please help me out?