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
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 :
Are the assumptions necessary to be considered ?
Or can if take that as a infinite train ?
@Anon ..Its The Constraints given for problem , 1st let us know approach for small input :)
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.
Have you found an efficient solution yet?
Post a Comment