Блог пользователя mHr029

Автор mHr029, история, 8 лет назад, По-английски

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

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
8 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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