Arithmetic Expression

Problem : https://www.codechef.com/problems/ARITHEXP/

My Solution : https://www.codechef.com/viewsolution/27434032

Why this dp solution is giving TLE