洛谷 | P1226 【快速幂】

快速幂 题目链接 题目描述 输入b,p,k的值,求b^p mod k的值。其中b,p,k*k为长整型数。 输入输出格式 时空限制 时间:1000ms 空间:128MB 代码 #include <iostream> #include <cstdio> using namespace std; typedef long long LL; //求 a^b % m,迭代写法 LL binaryPow(L
相关文章
相关标签/搜索