Cody

Solution 2183177

Submitted on 30 Mar 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   Pass
x = 56; y = 1; n = 1; A_correct = 56; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 56

2   Fail
x = 1; y = 2; n = 8; A_correct = 18446744073709551615; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 1 A = 2 A = 4 A = 8 A = 16 A = 32 A = 64 A = 128 A = 256 A = 512 A = 1024 A = 2048 A = 4096 A = 8192 A = 16384 A = 32768 A = 65536 A = 131072 A = 262144 A = 524288 A = 1048576 A = 2097152 A = 4194304 A = 8388608 A = 16777216 A = 33554432 A = 67108864 A = 134217728 A = 268435456 A = 536870912 A = 1.0737e+09 A = 2.1475e+09 A = 4.2950e+09 A = 8.5899e+09 A = 1.7180e+10 A = 3.4360e+10 A = 6.8719e+10 A = 1.3744e+11 A = 2.7488e+11 A = 5.4976e+11 A = 1.0995e+12 A = 2.1990e+12 A = 4.3980e+12 A = 8.7961e+12 A = 1.7592e+13 A = 3.5184e+13 A = 7.0369e+13 A = 1.4074e+14 A = 2.8147e+14 A = 5.6295e+14 A = 1.1259e+15 A = 2.2518e+15 A = 4.5036e+15 A = 9.0072e+15 A = 1.8014e+16 A = 3.6029e+16 A = 7.2058e+16 A = 1.4412e+17 A = 2.8823e+17 A = 5.7646e+17 A = 1.1529e+18 A = 2.3058e+18 A = 4.6117e+18 A = 9.2234e+18

Assertion failed.

3   Fail
x = -1; y = 2; n = 8; A_correct = -18446744073709551615; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = -1 A = -2 A = -4 A = -8 A = -16 A = -32 A = -64 A = -128 A = -256 A = -512 A = -1024 A = -2048 A = -4096 A = -8192 A = -16384 A = -32768 A = -65536 A = -131072 A = -262144 A = -524288 A = -1048576 A = -2097152 A = -4194304 A = -8388608 A = -16777216 A = -33554432 A = -67108864 A = -134217728 A = -268435456 A = -536870912 A = -1.0737e+09 A = -2.1475e+09 A = -4.2950e+09 A = -8.5899e+09 A = -1.7180e+10 A = -3.4360e+10 A = -6.8719e+10 A = -1.3744e+11 A = -2.7488e+11 A = -5.4976e+11 A = -1.0995e+12 A = -2.1990e+12 A = -4.3980e+12 A = -8.7961e+12 A = -1.7592e+13 A = -3.5184e+13 A = -7.0369e+13 A = -1.4074e+14 A = -2.8147e+14 A = -5.6295e+14 A = -1.1259e+15 A = -2.2518e+15 A = -4.5036e+15 A = -9.0072e+15 A = -1.8014e+16 A = -3.6029e+16 A = -7.2058e+16 A = -1.4412e+17 A = -2.8823e+17 A = -5.7646e+17 A = -1.1529e+18 A = -2.3058e+18 A = -4.6117e+18 A = -9.2234e+18

Assertion failed.

4   Fail
x = 5; y = 3; n = 2; A_correct = 200; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 5 A = 15 A = 45 A = 135

Assertion failed.

5   Fail
x = 10; y = -5; n = 3; A_correct = 3255210; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 10 A = -50 A = 250 A = -1250 A = 6250 A = -31250 A = 156250 A = -781250 A = 3906250

Assertion failed.

6   Pass
x = 1; y = 0; n = 1; A_correct = 1; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 1

7   Pass
x = 1; y = 0; n = -1; A_correct = 'NaN'; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = "NaN"

8   Fail
x = 12; y = 1; n = 3; A_correct = 108; assert(isequal(wheat_chess(x,y,n),A_correct))

A = 0 A = 12 A = 12 A = 12 A = 12 A = 12 A = 12 A = 12 A = 12 A = 12

Assertion failed.