You are not logged in. Please login at www.codechef.com to post your questions!

×

Why is this code giving me TLE?

Solution. I know why a TLE occurs but I think my code is quite efficient over here as I have memoized it!

asked 11 Apr '15, 14:32

psych_cod3r's gravatar image

4★psych_cod3r
21
accept rate: 0%


Well no one answered it.. Just in case anyone needs it-> The reason was I was setting up my dp table as 0 and the possibility that the answer will be zero is high.... Hence it recomputed even if the answer was computed once.... So preset the dp table with a better value :)

link

answered 12 Apr '15, 19:21

psych_cod3r's gravatar image

4★psych_cod3r
21
accept rate: 0%

toggle preview
Preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:

×2,212
×729

question asked: 11 Apr '15, 14:32

question was seen: 682 times

last updated: 12 Apr '15, 19:21