Cody

# Problem 42636. Big Integer Multiplication

Solution 1556785

Submitted on 11 Jun 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass

2   Pass
a = [1 2 3;0 5 6]; b = [5 6;9 0]; c = BigIntMult(a,b); assert(isequal(c(:,find(any(c,1),1):end),[6 8 8 8;5 0 4 0]))

prodSize = 2 6 tNow = 0.0107

3   Pass
n = 1e2; m = 20; a = randi([0 9],n,m); b = randi([0 9],1,m); c = BigIntMult(a,b); for k = 1:n d = c(k,:); d = d(:,find(d,1):end); assert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b))))-48,d)) end

maxDigits = 70000 prodSize = 100 40 tNow = 0.0999

4   Fail
n = 1e2; m = 1e5; a = randi([0 9],n,m); b = randi([0 9],n,m); t1 = builtin('tic'); c = BigIntMult(a,b); score = builtin('toc',t1); for k = randi(n,1,3) d = c(k,:); d = d(:,find(d,1):end); assert(isequal(char(multiply(java.math.BigInteger(char(48+a(k,:))),java.math.BigInteger(char(48+b(k,:)))))-48,d)) end SetSolutionScore(round(5*score))

maxDigits = 70000 prodSize = 100 140000 tNow = 27.5353

Assertion failed.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!