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

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

Given n identical balls and m boxes. Count the number of ways to distribute n balls into m boxes so that there is no box contains more than k balls. Order of boxes is not important, i.e. (1-2-1) and (1-1-2) are the same and must be counted one way.

Constraints: n, m, k <= 1000

Example: n = 4; m = 3; k = 2 -> answer = 2 (2 ways to distribute are (1-1-2) and (0-2-2))

For Vietnamese, you can read the statement here.

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

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

Auto comment: topic has been updated by I_love_Kuroni (previous revision, new revision, compare).