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

Автор mistborn, 5 лет назад, По-английски

Say we are given the number of occurrences of each letter (lower case english alphabet). We have to find the number of all k length strings (unique) that can be formed using these letters (MOD 1e9 +7).

Example: a:2, b:1, c:1

k = 2

aa ab ac bc ca cb ba

Answer: 7

Constraints:

k <= 1e5

Total number of characters <= 1e5

I couldn't solve it. Any input is appreciated.

Полный текст и комментарии »

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

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

I submitted a solution to the Problem C of today's contest that works fine in my computer and other online IDE's that I have checked. But for some reason that I couldn't figure out I get a runtime error in codeforces. Can someone please show me what's wrong with my code. Problem:898C - Phone Numbers Submission:33317474

Полный текст и комментарии »

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