SPOJ PROBLEM EIDSALAMI2

Правка en1, от prrateekk, 2016-08-17 22:46:55

I've been trying this problem on spoj but not been able to come up with a optimal solution. The statement translates to — find number of ways to divide a number 'm' into 'n' distinct positive numbers.

1<=m,n<=10^6 also, m*n<=10^6

I was thinking of applying dp, but was stuck at it because it required all the numbers to be distinct. It is obvious that for all values of 'n' around 1400 and above, answer is 0.But that didn't help me in my approach.

Can dp be applied? Or could it be solved using other method?

Теги spoj

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский prrateekk 2016-08-18 00:30:46 375
en1 Английский prrateekk 2016-08-17 22:46:55 596 Initial revision (published)