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 | 3434 |

2 | Petr | 3353 |

3 | OO0OOO00O0OOO0O0…O | 3314 |

4 | fateice | 3306 |

5 | Um_nik | 3286 |

6 | Syloviaely | 3274 |

7 | dotorya | 3145 |

8 | LHiC | 3114 |

9 | Radewoosh | 3098 |

10 | mnbvmar | 3096 |

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

1 | tourist | 178 |

2 | rng_58 | 166 |

3 | Petr | 155 |

3 | csacademy | 155 |

5 | Swistakk | 149 |

5 | lewin | 149 |

7 | Um_nik | 142 |

8 | Errichto | 140 |

9 | matthew99 | 138 |

9 | Vovuh | 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-2018 Mike Mirzayanov

The only programming contests Web 2.0 platform

Server time: Jun/23/2018 11:08:30 (d1).

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.