Help in spoj trigraph problem

Revision en3, by pushkar31, 2021-01-22 19:46:28

Can anyone plz tell me why my code gives tle.On google search most of them have solved it using bottom top dp. Here's the lonk for problem.Is there any bug in my code or top bottom is slow due to function calls?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en4 English pushkar31 2021-01-23 09:43:28 39 Tiny change: 'ion calls?' -> 'ion calls? I have added code in comments thank u.'
en3 English pushkar31 2021-01-22 19:46:28 1191
en2 English pushkar31 2021-01-22 19:34:02 20
en1 English pushkar31 2021-01-22 19:27:20 1454 Initial revision (published)