Saturday, May 19, 2012

Power Tower Problem-

Given two power towers, find out which one is larger. Power tower is a number of the form : a1 ^ ( a2 ^ (a3 ^ (.... ^an)

You can assume that N <= 100, and each ai <= 100.
I don't have any efficient solution yet.

Source:
A sub-task in ICPC world finals 2012

4 comments :

Anonymous said...

Are the assumptions necessary to be considered ?

Or can if take that as a infinite train ?

Unknown said...

@Anon ..Its The Constraints given for problem , 1st let us know approach for small input :)

Anonymous said...

I'm not too sure...

But if we are going to be dealing with such huge powers then only the base should really matter

Let y= the power train.
Take log, then log y = y * log a1.

Thomas DA said...

Have you found an efficient solution yet?