Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

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

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

((n+m)Cn) %mod here n and m can be upto 10^9 and mod is 10^6+3. Can someone help me in this calculating the correct answer

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

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

You should not ask for the solution of a problem from a running contest. Try yourself or wait for the contest to end.

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

look at this thread for calculating N!%M in O(MlogN)

and use this fact N! - 1%M = (N!%M)M - 2%M