http://codeforces.net/problemset/problem/414/B
Can anyone help me in understand the problem.Just need explaination.Thanks in advance
# | User | Rating |
---|---|---|
1 | tourist | 4009 |
2 | jiangly | 3823 |
3 | Benq | 3738 |
4 | Radewoosh | 3633 |
5 | jqdai0815 | 3620 |
6 | orzdevinwang | 3529 |
7 | ecnerwala | 3446 |
8 | Um_nik | 3396 |
9 | ksun48 | 3390 |
10 | gamegame | 3386 |
# | User | Contrib. |
---|---|---|
1 | cry | 164 |
1 | maomao90 | 164 |
3 | Um_nik | 163 |
4 | atcoder_official | 160 |
4 | adamant | 160 |
6 | -is-this-fft- | 158 |
7 | awoo | 157 |
8 | TheScrasse | 154 |
8 | Dominater069 | 154 |
8 | nor | 154 |
http://codeforces.net/problemset/problem/414/B
Can anyone help me in understand the problem.Just need explaination.Thanks in advance
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.
Let 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.