Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- you can calculate modular inverses to first n integers in O(n) time using this formula: inv[i] = (-(p+i-1)/i + inv[p%i] + p)%p;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement