Cody

Solution 458080

Submitted on 18 Jun 2014 by goc3
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
%% sum_up = 5*rand; % sum of array should be this n = randi(10); %number of elements in array sum_array = []; for times = 1:100 for i = 1:n sum_array(i,1) = fill_array_sum_up_to(sum_up,n,sum_array); end checksum(times) = all(diff(sort(sum_array))); end assert(all(checksum));

s = 0 b = 2.6070 s = 1 b = 2.7069 s = 2 b = 4.3316 s = 3 b = 8.7561 s = 4 b = 0.9896 s = 5 b = 6.5757 s = 6 b = 7.8142 s = 7 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 0 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 1.1102e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 0 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 1.1102e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 0 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 1.1102e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 0 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 1.1102e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 0 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 1.1102e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 5.5511e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = 3.2196e-15 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s = 8 b = 8.7561 s = 8 b = 0.9896 s = 8 b = 6.5757 s = 8 b = 7.8142 s = 8 b = -33.3548 s = 8 b = -3.3307e-16 s = 8 b = 2.6070 s = 8 b = 2.7069 s = 8 b = 4.3316 s ...