Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.
Example1:
Example2:
解法1: 二分分割
参考了这篇解答1,主要的思想还是做二分分割。用到的性质是
然后判断下是否是偶数或者奇数。这里需要记忆一个高精度除法的计算方法。
Your task is to calculate ab mod 1337 where a is a positive integer and b is an extremely large positive integer given in the form of an array.
Example1:
Example2:
参考了这篇解答1,主要的思想还是做二分分割。用到的性质是
然后判断下是否是偶数或者奇数。这里需要记忆一个高精度除法的计算方法。