Cody

# Problem 2228. Time Expansion

Solution 1928898

Submitted on 10 Sep 2019
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
n=4 x=[2 1 2 3 4 5 -3 4 -1 2 2 2] y_correct = [2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 0 0 -1 0 0 0 2 0 0 0 2 0 0 0 2]; assert(isequal(time_expansion(x,n),y_correct))

n = 4 x = 2 1 2 3 4 5 -3 4 -1 2 2 2 y = 2 0 0 0 y = 2 0 0 0 1 0 0 0 y = 2 0 0 0 1 0 0 0 2 0 0 0 y = 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 y = 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 y = 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 y = 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 y = Columns 1 through 30 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 Columns 31 through 32 0 0 y = Columns 1 through 30 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 Columns 31 through 36 0 0 -1 0 0 0 y = Columns 1 through 30 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 Columns 31 through 40 0 0 -1 0 0 0 2 0 0 0 y = Columns 1 through 30 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 Columns 31 through 44 0 0 -1 0 0 0 2 0 0 0 2 0 0 0 y = Columns 1 through 30 2 0 0 0 1 0 0 0 2 0 0 0 3 0 0 0 4 0 0 0 5 0 0 0 -3 0 0 0 4 0 Columns 31 through 48 0 0 -1 0 0 0 2 0 0 0 2 0 0 0 2 0 0 0

Assertion failed.

2   Pass
n=1 x=[2 1 2 3 4 5 -3 4 -1 2 2 2] y_correct=x; assert(isequal(time_expansion(x,n),y_correct))

n = 1 x = 2 1 2 3 4 5 -3 4 -1 2 2 2 y = 2 y = 2 1 y = 2 1 2 y = 2 1 2 3 y = 2 1 2 3 4 y = 2 1 2 3 4 5 y = 2 1 2 3 4 5 -3 y = 2 1 2 3 4 5 -3 4 y = 2 1 2 3 4 5 -3 4 -1 y = 2 1 2 3 4 5 -3 4 -1 2 y = 2 1 2 3 4 5 -3 4 -1 2 2 y = 2 1 2 3 4 5 -3 4 -1 2 2 2

3   Fail
n=5 x=[2 1 2 3 4] y_correct=[2 0 0 0 0 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4]; assert(isequal(time_expansion(x,n),y_correct))

n = 5 x = 2 1 2 3 4 y = 2 0 0 0 0 y = 2 0 0 0 0 1 0 0 0 0 y = 2 0 0 0 0 1 0 0 0 0 2 0 0 0 0 y = 2 0 0 0 0 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 y = 2 0 0 0 0 1 0 0 0 0 2 0 0 0 0 3 0 0 0 0 4 0 0 0 0

Assertion failed.