首页 > 其他 > 详细

Super A^B mod C

时间:2014-07-29 11:08:56      阅读:552      评论:0      收藏:0      [点我收藏+]

Given A,B,C, You should quickly calculate the result of A^B mod C. (1<=A,C<=1000000000,1<=B<=10^1000000).

Input

There are multiply testcases. Each testcase, there is one line contains three integers A, B and C, separated by a single space.

Output

For each testcase, output an integer, denotes the result of A^B mod C.

Sample Input

3 2 4
2 10 1000

Sample Output

1
24
 
处理大数的方法挺经典的,把别人代码贴出来以示膜拜
bubuko.com,布布扣view code

Super A^B mod C,布布扣,bubuko.com

Super A^B mod C

原文:http://www.cnblogs.com/zyx1314/p/3873888.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!