Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

CSES DP SECTION — Book Shop

Revision en2, by AC_AC, 2020-12-30 07:09:24

I was solving Book Shop of CSES DP section.

  • I am getting TLE even after multiple attempts, Can you tell me how to optimize my TOP-DOWN approach.
  • I have tried replacing 2-d array with 2-d vector .
  • I have also tried swapping the dimensions of dp array (_some caching thing_).
my code

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en3 English AC_AC 2020-12-30 07:10:17 2
en2 English AC_AC 2020-12-30 07:09:24 93
en1 English AC_AC 2020-12-30 07:00:57 991 Initial revision (published)