combinations - Finding (2n C n) mod (1000000006) -


i trying solve problem on spoj - http://www.spoj.com/problems/powpow/ have reduced stage have find (a ^ (exp % (m-1))) % m,(m = 1000000007) using fermat's little theorem. face big problem find exp % m. can not use inverse modulo here find 1/(n!) mod (m-1) since gcd(n!, m-1) != 1. have researched lot on google , programming websites this. thing have found use chinese remainder theorem solve these equations: n = 1 mod 2 n = exp mod 500000003 , n exp % (m-1) not able understand how can reach these equations? there other way solve this?


Comments

Popular posts from this blog

windows - Single EXE to Install Python Standalone Executable for Easy Distribution -

c# - Access objects in UserControl from MainWindow in WPF -

javascript - How to name a jQuery function to make a browser's back button work? -