mistborn's blog

By mistborn, 5 years ago, In English

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.

Full text and comments »

  • Vote: I like it
  • +8
  • Vote: I do not like it

By mistborn, history, 7 years ago, In English

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

Full text and comments »

  • Vote: I like it
  • -6
  • Vote: I do not like it