mirror of
https://github.com/Hizenberg469/Algorithms-snippets.git
synced 2026-04-19 22:52:23 +03:00
Binomial Coefficient
This commit is contained in:
@@ -1,12 +1,12 @@
|
||||
//Extended gcd -> Recursive
|
||||
|
||||
tuple<int,int,int> extended_gcd( int a, int b){
|
||||
|
||||
if( b == 0 ){
|
||||
return {1,0,a};
|
||||
}
|
||||
|
||||
int x,y,g;
|
||||
tie(x,y,g) = extended_gcd( b , a%b );
|
||||
return {y , x - (a/b)*y , g};
|
||||
//Extended gcd -> Recursive
|
||||
|
||||
tuple<int,int,int> extended_gcd( int a, int b){
|
||||
|
||||
if( b == 0 ){
|
||||
return {1,0,a};
|
||||
}
|
||||
|
||||
int x,y,g;
|
||||
tie(x,y,g) = extended_gcd( b , a%b );
|
||||
return {y , x - (a/b)*y , g};
|
||||
}
|
||||
Reference in New Issue
Block a user