Horje
multiply two numbers <=10^18 %m in cpp Code Example
multiply two numbers <=10^18 %m in cpp
long long mul(long long a, long long b){
    if(b == 0)
        return 0;
    if(b & 1)
        return (mul(a, b - 1) + a) % mod;
    long long half = mul(a, b >> 1);
    return (half + half) % mod;
}
/* Credits tr0j4n034 at github as solution of MAS from spoj*/




Cpp

Related
quotation in c++ string Code Example quotation in c++ string Code Example
reverse an array in c++ stl Code Example reverse an array in c++ stl Code Example
c++ console color some digits Code Example c++ console color some digits Code Example
print hello world on c++ Code Example print hello world on c++ Code Example
default access modifier in c++ in struct Code Example default access modifier in c++ in struct Code Example

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