Cody

# Problem 1286. MatCAT - Reconstruct X from Its X-rays

Solution 2613517

Submitted on 25 Jun 2020
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   Fail
row_sums = [3 5 11]; col_sums = [4 7 8]; x = matcat(row_sums,col_sums); assert(all(x(:)>=0)) assert(isequal(floor(x),x)) assert(isequal(sum(x,2)',row_sums)) assert(isequal(sum(x,1),col_sums))

M = 3 4 1 M = 3 1 4 3 1 3 M = 3 1 1 4 3 1 1 3 2

Output argument "x" (and maybe others) not assigned during call to "matcat". Error in Test1 (line 3) x = matcat(row_sums,col_sums);

2   Fail
row_sums = [2 2 2 2 2 6]; col_sums = [2 3 3 3 3 2]; x = matcat(row_sums,col_sums); assert(all(x(:)>=0)) assert(isequal(floor(x),x)) assert(isequal(sum(x,2)',row_sums)) assert(isequal(sum(x,1),col_sums))

M = 1 0 0 1 0 1 M = 1 2 0 1 0 0 1 0 0 0 1 0 M = 1 2 1 0 1 0 0 0 0 1 0 1 0 0 0 1 0 1 M = 1 2 1 1 0 1 0 2 0 0 0 0 1 0 1 0 0 0 0 0 1 0 1 0 M = 1 2 1 1 1 0 1 0 2 0 0 0 0 0 0 1 0 1 0 1 0 0 0 0 0 1 0 1 0 1 M = 1 2 1 1 1 0 0 1 0 2 0 0 0 0 0 0 0 1 1 0 1 0 1 0 0 0 0 0 0 0 1 0 1 0 1 2

Output argument "x" (and maybe others) not assigned during call to "matcat". Error in Test2 (line 3) x = matcat(row_sums,col_sums);

3   Fail
row_sums = [65 65 65 65 65]; col_sums = [65 65 65 65 65]; x = matcat(row_sums,col_sums); assert(all(x(:)>=0)) assert(isequal(floor(x),x)) assert(isequal(sum(x,2)',row_sums)) assert(isequal(sum(x,1),col_sums))

M = 5 19 6 4 31 M = 5 7 19 41 6 5 4 3 31 9 M = 5 7 17 19 41 26 6 5 2 4 3 4 31 9 16 M = 5 7 17 6 19 41 26 0 6 5 2 0 4 3 4 56 31 9 16 3 M = 5 7 17 6 4 19 41 26 0 21 6 5 2 0 27 4 3 4 56 12 31 9 16 3 1

Output argument "x" (and maybe others) not assigned during call to "matcat". Error in Test3 (line 3) x = matcat(row_sums,col_sums);

4   Fail
row_sums = [22 34 33]; col_sums = [15 23 18 21 12]; x = matcat(row_sums,col_sums); assert(all(x(:)>=0)) assert(isequal(floor(x),x)) assert(isequal(sum(x,2)',row_sums)) assert(isequal(sum(x,1),col_sums))

M = 4 13 2 1 3 M = 4 2 13 3 2 6 1 8 3 4 M = 4 2 10 13 3 4 2 6 0 1 8 5 3 4 4

Output argument "x" (and maybe others) not assigned during call to "matcat". Error in Test4 (line 3) x = matcat(row_sums,col_sums);

5   Fail
row_sums = 55; col_sums = [1 2 3 4 5 6 7 8 9 10]; x = matcat(row_sums,col_sums); assert(all(x(:)>=0)) assert(isequal(floor(x),x)) assert(isequal(sum(x,2)',row_sums)) assert(isequal(sum(x,1),col_sums))

M = 0 0 0 0 1 1 0 1 0 0

Output argument "x" (and maybe others) not assigned during call to "matcat". Error in Test5 (line 3) x = matcat(row_sums,col_sums);