Cody

# Problem 1174. Wheat on a chessboard pt 2

Solution 1692223

Submitted on 14 Dec 2018 by HH
• Size: 9
• This is the leading solution.
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))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint1 (line 5) In solutionTest (line 3)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint2 (line 5) In solutionTest (line 5)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint3 (line 5) In solutionTest (line 7)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint4 (line 5) In solutionTest (line 9)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint5 (line 5) In solutionTest (line 11)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint6 (line 5) In solutionTest (line 13)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint7 (line 5) In solutionTest (line 15)] ans = 1

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

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In unix (line 32) In wheat_chess (line 2) In ScoringEngineTestPoint8 (line 5) In solutionTest (line 17)] ans = 1

### Community Treasure Hunt

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

Start Hunting!