#10408. 【基础】快速幂
【基础】快速幂
说明
求xp mod m 的值。提示:若 p 为偶数,xp=(x2)p/2;若 p 为奇数,xp=x*(x2)(p-1)/2,该题可以采用分治法求解。
输入格式
三个不超过 10000 的正整数 x,p,m。输出格式
xp mod m 的值。2 10 100
24
2 10 100
24
By signing up a 津桥OJ universal account, you can submit code and join discussions in all online judging services provided by us.