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

Автор _BAD_, 2 года назад, По-английски

Hi,

Can you please share your thoughts on the following question:

Problem: Count the number of ways (modulo mod) to divide n people into ceil(n/k) group(s), such that each group has no more than k people.

Constraints: In each file, only one of the following constraints will be applied:

  • n <= 10^5; mod <= 10^18
  • n <= 10^9; mod = 10^9 + 7

Example: n = 10, k = 4, mod = 1000000007 -> Answer: 6

Ways:

  • 2 | 4 | 4

  • 4 | 2 | 4

  • 4 | 4 | 2

  • 3 | 3 | 4

  • 3 | 4 | 3

  • 4 | 3 | 3

Thanks in advance.

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

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

Source?