CodeForces 247 div2C

Правка en3, от tirupati, 2015-07-03 11:21:04

This is my first blog post here and also this is the first dp problem I was able to solve by myself. So, I thought I should celebrate it by publishing a blog entry. Here it goes..., We have to find the sum of the numbers(range[1...k]) such that their sum forms n. Also it's given that there must be at least one entry with value >=d. So this is equivalent to...

Required Number of Paths = (total number of paths which sum to n using range[1...k]) - (total number of paths which sum to n using range[1...d-1])

Each of the two subproblems on the R.H.S can be individually solved using dp. You can see the solution here

PS: Feel free to suggest improvements or show up bugs :D Thank You..,

Теги dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en4 Английский tirupati 2015-07-03 13:06:24 183
en3 Английский tirupati 2015-07-03 11:21:04 60
en2 Английский tirupati 2015-07-03 11:19:38 434 (published)
en1 Английский tirupati 2015-07-03 11:13:33 296 Initial revision (saved to drafts)