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

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

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!!

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

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

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.