Skip to content

Commit

Permalink
Update ext_gcd&inv.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Pentagon03 authored Aug 2, 2024
1 parent 5cdd1c8 commit e80d6a6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Math/ext_gcd&inv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ ll inv(ll a, ll m){
if(g != 1) return -1;
return (x%m + m) % m;
}
// inv(i) = inv(p % i) * (-p / i)

// do_smth for x,y that ax + by = s, x >= 0 && y >= 0
bool do_smth(ll a, ll b, ll s){
Expand All @@ -34,4 +35,4 @@ bool do_smth(ll a, ll b, ll s){
}
}
return true;
}
}

0 comments on commit e80d6a6

Please sign in to comment.