dog_mage's blog

By dog_mage, history, 9 years ago, In English

Link :https://online.acmicpc.org/problems/ceiling

I had an idea to solve this problem in O(n^2) by just presenting tree as String.For example we will have 2 trees(both used to compare each other).If we have List : 5 6 3 9 the string representation of this tree wouls be "RLRR" which means they were added in the tree in following order.After i build both trees i would check if they have same property(amount of L's and R's) if that is the case i would mark those trees the same.

My soulution is giving WA on 7th case and i wonder what it is?

Thanks

Full text and comments »

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