ZOJ ~ 3609 ~ Modular Inverse (擴展歐幾里得,乘法逆元)

題意 求a*x ≡ 1(mod m),求最小的正整數 x ,如果沒有解輸出 「Not Exist」。 思路 求乘法逆元。a*x ≡ 1(mod m)轉化爲 ,求最小的正!整數 x 。 #include<bits/stdc++.h> using namespace std; typedef long long LL; void exgcd(int a, int b, int& d, int& x,
相關文章
相關標籤/搜索