鲅鱼圈网站在哪做,vs2013网站开发教程,我国做民宿的网站,wordpress本地服务器描述 求 a 乘 b 对 p 取模的值#xff0c;其中 1≤a,b,p≤10^18。 输入格式 第一行a#xff0c;第二行b#xff0c;第三行p。 输出格式 一个整数#xff0c;表示a*b mod p的值。 样例输入 2 3 9 样例输出 6 #include bits/stdc.h
using namespace std;
const int M…描述 求 a 乘 b 对 p 取模的值其中 1≤a,b,p≤10^18。 输入格式 第一行a第二行b第三行p。 输出格式 一个整数表示a*b mod p的值。 样例输入 2 3 9 样例输出 6 #include bits/stdc.h
using namespace std;
const int MAXN 1e55;
const int INF 0x3f3f3f3f;
int n, ans;
#define ll long long
ll a,b,p;
ll qmod(ll a,ll b,ll p)
{ll res0; //while(b){if(b1)res(res%pa%p)%p; //a(aa)%p; //b1;}return res%p;
}
int main()
{while(~scanf(%lld%lld%lld,a,b,p)){printf(%lld\n,qmod(a,b,p));}return 0;
} 转载于:https://www.cnblogs.com/Roni-i/p/9251929.html