Problem 1: Tetration

https://open.kattis.com/problems/tetration

We want to output aa that satisfies:

N=aaa... N = a^{a^{a^{.^{.^{.}}}}}

The exponent of the right-hand-side is aa... a^{a^{.^{.^{.}}}} , which is equal to NNas well.

So, N=aN    a=N1N N = a^N \implies a = N^{\frac{1}{N}} .

This can be implemented in C++ using the pow(base, exponent) function and doubles.

Last updated