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


Why is my recursive solution of this(link given) spoj problem giving me WA?

I was doing this spoj problem and written tabulation method which got accepted, then I wrote recursive solution but this gave me the wrong solution(WA), Where is my recursive solution is wrong:-

my tabulation solution which got AC.

I want to ask:-

1). What is wrong with my recursive solution.

2). Can we do all dp problem with tabulation and memoization i.e if we can do with memoization than can we do with tabulation and vice versa for every dp problem?

asked 27 Apr '18, 01:12

vikram91's gravatar image

accept rate: 0%

edited 27 Apr '18, 02:50

toggle preview

Follow this question

By Email:

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



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "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:


question asked: 27 Apr '18, 01:12

question was seen: 95 times

last updated: 27 Apr '18, 02:50