乘法逆元模板

#include<bits/stdc++.h>
using namespace std;
const int maxn=200;
typedef long long ll;
const ll mod=998244353;
ll pow_m (ll a,ll b,ll mod) {
    ll res=1;
    for (;b;b>>=1,a=a*a%mod)
        if (b&1) res=res*a%mod;
    return res;
}
ll inv (ll a,ll mod) {
    return pow_m(a,mod-2,mod);
}

int main () {
    
}
原文地址:https://www.cnblogs.com/zhanglichen/p/13448228.html