Help needed to understand problem 559C

Правка en1, от akash_goel, 2015-07-24 20:24:01

Here is the link — http://codeforces.me/problemset/problem/559/C This is similar to this — https://www.codechef.com/CDCRF15R/problems/CWAYS/

In the solutions, I can see inverse factorial being calculated as

inv(n) = pow(n,mod-2)

I don't get where the mod-2 value comes from. Can someone please explain?

Теги combinatorics, dp

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский akash_goel 2015-07-24 20:24:01 378 Initial revision (published)