http://codeforces.com/problemset/problem/414/B

Can anyone help me in understand the problem.Just need explaination.Thanks in advance

# | User | Rating |
---|---|---|

1 | tourist | 3438 |

2 | moejy0viiiiiv | 3288 |

3 | W4yneb0t | 3218 |

4 | LHiC | 3196 |

5 | TakanashiRikka | 3178 |

6 | Petr | 3163 |

7 | Um_nik | 3150 |

8 | izrak | 3109 |

9 | ershov.stanislav | 3105 |

10 | mnbvmar | 3018 |

# | User | Contrib. |
---|---|---|

1 | rng_58 | 179 |

2 | tourist | 171 |

3 | csacademy | 170 |

4 | Petr | 162 |

5 | Swistakk | 158 |

6 | Errichto | 156 |

7 | Zlobober | 152 |

7 | matthew99 | 152 |

9 | zscoder | 139 |

10 | Endagorion | 138 |

http://codeforces.com/problemset/problem/414/B

Can anyone help me in understand the problem.Just need explaination.Thanks in advance

↑

↓

Codeforces (c) Copyright 2010-2017 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Sep/22/2017 20:02:51 (c2).

Desktop version, switch to mobile version.

User lists

Name |
---|

A sequence is called good if all the numbers are divided by its previous number(excluding the first number ofcourse). So a sequence like — 1,4,12,36 is called good but 1,4,8,14 is not good.

Now you will be given n (the maximum number you can use in the sequence) and k (length of sequence). You have to tell how many sequences can be made out of these restrictions.

Solution HintLet dp[k][cur] be the number of good sequences with k numbers that ends with cur. So —

Recurrence : From a number cur we can move to all the divisors of cur. Say the divisors of cur are — x1, x2, x3, ... xn. Then our recurrence will look like —

Base case : It's easy to tell that base case is for n = 1. (Figure out what you have to do then)

Now you only need to find a good way to store all the divisors of the numbers from 1 to 2000.

You can see my code if you get stuck : 27958781

Thanks brother.