British Algorithmic Olympiad 2023 Solutions

Question 1. High Rise A For this problem we are given a recursive relation \begin{equation} T(n) = \bigg\lceil \log_{10}(n^4)\bigg\rceil+T(n-1)+\bigg\lceil\frac{7}{20000}T(n-2)\bigg\rceil \end{equation} The evaluation of $T(ef)$ for buildings with an EDC of 23 could use simple recursion for small values of $f$. But we are asked to write down the value at the theoretical 498th floors. Without memorization such a task is not possible for someone who is not working for Google! 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 from math import ceil , log T_ = [ 2 , 2 ] + [ None ] * 23 * 499 def T ( n ): if T_ [ n - 1 ] == None : # remember T_ is zero offset temp = T ( n - 1 ) + ceil ( 7 * T ( n - 2 ) / 2000 ) + ceil ( 4 * log ( n , 10 )) T_ [ n - 1 ] = temp return temp else : return T_ [ n - 1 ] e = 23 TEDC = [] for f in range...