Help to solve this dp problem

Правка en3, от Tanvir_Rasel, 2021-02-02 12:46:25

In this, (https://www.spoj.com/problems/TAP2012C/en/) problem, we need to find the total number in range D and H based on some property which gives in set C and a given base B.

My approach to solve this is using digit dp. I use 4 state in my dp, first is position and I use a mask for calculating which digit is using for making this number and use is_start for starting position and using nf for checking the limit. I use a flag value for checking 0 digit.

But I can not figure out what is wrong with my approach, please help me to solve this problem.

My code is here: https://ideone.com/IHsTfK

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en3 Английский Tanvir_Rasel 2021-02-02 12:46:25 1
en2 Английский Tanvir_Rasel 2021-02-02 12:30:48 11
en1 Английский Tanvir_Rasel 2021-02-01 16:03:54 644 Initial revision (published)