yogesh01's blog

By yogesh01, history, 9 years ago, In English

http://main.edu.pl/en/archive/oi/2/drz I have been stuck on this problem for 8 hours. Please help me with this. Thanks!!

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

| Write comment?
»
9 years ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

Take first one (from left) of deepest leaves. Guy on its right has to have same depth, let it be d (otherwise print "NIE"). We can delete both and put there d-1 and recurse and recover whole tree.