how to find muliplication of large numbers modulo 100000007

后端 未结 3 1803
我寻月下人不归
我寻月下人不归 2020-12-17 08:05

As we know 1000000007 is a large prime number. How can I find multiplication of two large numbers modulo 1000000007

For example if I want to find 78627765*67527574 m

3条回答
  •  执念已碎
    2020-12-17 08:45

    Since this looks like a homework or context problem, I will only give hints.

    If you know x%m and y%m, how can you find (x+y)%m? If you know x%m, how can you find (2x)%m?

    Since you want to find (a*b)%m, is there a way you can decompose b so that you can use the above two hints?

提交回复
热议问题