SAT2020's blog

By SAT2020, history, 20 months ago, In English

Can anyone please help me understand why my code gives TLE?

https://mirror.codeforces.com/contest/1796/submission/195509093

I basically followed the editorial exactly but used memorization instead of bottom-up.

In general, is bottom-up faster, or is my implementation just flawed?

  • Vote: I like it
  • +3
  • Vote: I do not like it

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

looks like u solved it urself that's pretty sheesh : )

»
20 months ago, # |
  Vote: I like it 0 Vote: I do not like it

Don't use long long when its unnecessary