kamalnitrkl's blog

By kamalnitrkl, history, 8 years ago, In English

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

  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?
»
8 years ago, # |
Rev. 2   Vote: I like it 0 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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?