mHr029's blog

By mHr029, history, 7 years ago, In English

Can anyone give me some ideas for the following problem? http://lightoj.com/volume_showproblem.php?problem=1095

  • Vote: I like it
  • 0
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

The solution idea comes from dearrangement. At a time from first m integer you have to dearrange (m-k) integer. And also from (m+1)'th to n'th integer you can dearrange them or not. So iterate over (n-m) and for every time suppose i you keep them at their position, so you have (n-k-i) integer which you can dearrange. Add those ways in every iteration. And at last multiply with mCk