Advertisement

同余方程的逆元

阅读量:
在这里插入图片描述
在这里插入图片描述

思路:

逆元相关模板题目

代码:

复制代码
    #include<iostream>
    #include<string>
    #include<cstdio>
    #include<cmath>
    #include<cstring>
    #include<algorithm>
    using namespace std;
    long long exgcd(long long a , long long b , long long &x , long long &y)
    {
    if(b == 0)
    {
        x = 1;y = 0;
        return a;
    }
    long long gcd = exgcd(b , a % b , x , y);
    l

全部评论 (0)

还没有任何评论哟~