astrothegod's blog

By astrothegod, history, 3 years ago, In English

The problem is calculate nCk with n <= 10^18, k <= 10^6 and mod = 10^9 + 7. Can anyone give me some hints or pesudo code. Thanks

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

| Write comment?
»
3 years ago, # |
Rev. 4   Vote: I like it +19 Vote: I do not like it

just calc,k is small

n!/(n-k)!k!

as (n-k) is big, you can do simplify