WA! in SPOJ SEQ — Help .

Revision en1, by MayankPratap, 2016-06-23 08:28:21

Hello everyone, I was practicing dynamic programming and I came across this problem :- http://www.spoj.com/problems/SEQ/ . I read a blog on solving linear recurrences here :- http://fusharblog.com/solving-linear-recurrence-for-programming-contest/ and used same technique to solve the problem .

My output for sample cases is correct but I am getting WA on submit. My solution is http://pastebin.com/tYt0LCw2 . Can anybody help me ? I am new to dynamic programming.

Tags spoj, dynamic programming, recurrence

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English MayankPratap 2016-06-23 08:28:21 496 Initial revision (published)