Horje
Modulo Exponentiaon,Iteratve Modulo Exponentiation Code Example
Modulo Exponentiaon,Iteratve Modulo Exponentiation
long long binpow(long long a, long long b, long long m) {
    a %= m;
    long long res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}




Cpp

Related
binary exponentiation Code Example binary exponentiation Code Example
initialize an array in c++ Code Example initialize an array in c++ Code Example
c++ data structures Code Example c++ data structures Code Example
c++ merge sort Code Example c++ merge sort Code Example
file open cpp Code Example file open cpp Code Example

Type:
Code Example
Category:
Coding
Sub Category:
Code Example
Uploaded by:
Admin
Views:
8