Tle on test case 6 Problem366C

Revision en1, by BanazadehAria, 2019-06-29 12:56:13

Hi I wrote top-down dp for this problem but my code gets TLE for test case 6 I must change it to bottom-up or there is a trick to don't get TLE?

My code ==> https://mirror.codeforces.com/contest/366/submission/56265597

Problem Link ==> https://mirror.codeforces.com/contest/366/problem/C

Tags #dynamic programmign, #tle

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English BanazadehAria 2019-06-29 15:41:20 55 Tiny change: '/problem/C' -> '/problem/C\n\nAny type of help is appreciated. Thanks in advance.'
en1 English BanazadehAria 2019-06-29 12:56:13 309 Initial revision (published)