codeforces 414B << link
asked 24 Oct '17, 20:33

http://codeforces.com/contest/414/submission/30988220 Here is my solution. What i did was to at first generate all the factors for all no.s from 1 to n and store them in a vector. factors[i] is a vector that stores all the factors of i. Now i need sequences of length k so my dp states become k(in my code it is n in the function) the current index i am at and l i.e the last element chosen in current set.So to choose 1 more element i need to choose some factor of l. Read my code hopefully you will get it. answered 24 Oct '17, 21:43
