Cody

Solution 805266

Submitted on 12 Jan 2016 by Tanzil Bin Hassan
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 = 1; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 1 sum = 1 y = 1

2   Pass
%% x = 9; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 9 sum = 9 y = 1

3   Pass
%% x = 10; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 10 sum = 1 sum = 1 y = 0

4   Pass
%% x = 99; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 99 sum = 81 sum = 162 y = 0

5   Pass
%% x = 152; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 152 sum = 1 sum = 126 sum = 134 y = 0

6   Pass
%% x = 153; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 153 sum = 1 sum = 126 sum = 153 y = 1

7   Pass
%% x = 154; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 154 sum = 1 sum = 126 sum = 190 y = 0

8   Pass
%% x = 371; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 371 sum = 27 sum = 370 sum = 371 y = 1

9   Pass
%% x = 370; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 370 sum = 27 sum = 370 sum = 370 y = 1

10   Pass
%% x = 1634; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 1634 sum = 1 sum = 1297 sum = 1378 sum = 1634 y = 1

11   Pass
%% x = 8207; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 8207 sum = 4096 sum = 4112 sum = 4112 sum = 6513 y = 0

12   Pass
%% x = 9474; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 9474 sum = 6561 sum = 6817 sum = 9218 sum = 9474 y = 1

13   Pass
%% x = 9926315; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 9926315 sum = 4782969 sum = 9565938 sum = 9566066 sum = 9846002 sum = 9848189 sum = 9848190 sum = 9926315 y = 1

14   Pass
%% x = 88593477; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 88593477 sum = 16777216 sum = 33554432 sum = 33945057 sum = 76991778 sum = 76998339 sum = 77063875 sum = 82828676 sum = 88593477 y = 1

15   Pass
%% x = 9800817; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 9800817 sum = 4782969 sum = 6880121 sum = 6880121 sum = 6880121 sum = 8977273 sum = 8977274 sum = 9800817 y = 1

16   Pass
%% x = 54748; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 54748 sum = 3125 sum = 4149 sum = 20956 sum = 21980 sum = 54748 y = 1

17   Pass
%% x = 4679307774; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 4.6793e+09 sum = 1048576 sum = 61514752 sum = 343990001 sum = 3.8308e+09 sum = 3.8308e+09 sum = 3.8308e+09 sum = 4.1133e+09 sum = 4.3958e+09 sum = 4.6783e+09 sum = 4.6793e+09 y = 1

18   Pass
%% x = 472335975; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 472335975 sum = 262144 sum = 40615751 sum = 40616263 sum = 40635946 sum = 40655629 sum = 42608754 sum = 430029243 sum = 470382850 sum = 472335975 y = 1

19   Pass
%% x = 32164049650; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 3.2164e+10 sum = 177147 sum = 179195 sum = 179196 sum = 362976252 sum = 367170556 sum = 367170556 sum = 371364860 sum = 3.1752e+10 sum = 3.2115e+10 sum = 3.2164e+10 sum = 3.2164e+10 y = 1

20   Pass
%% x = 32164049651; y_correct = true; assert(isequal(isnarcissistic(x),y_correct))

x = 3.2164e+10 sum = 177147 sum = 179195 sum = 179196 sum = 362976252 sum = 367170556 sum = 367170556 sum = 371364860 sum = 3.1752e+10 sum = 3.2115e+10 sum = 3.2164e+10 sum = 3.2164e+10 y = 1

21   Pass
%% x = 32164049652; y_correct = false; assert(isequal(isnarcissistic(x),y_correct))

x = 3.2164e+10 sum = 177147 sum = 179195 sum = 179196 sum = 362976252 sum = 367170556 sum = 367170556 sum = 371364860 sum = 3.1752e+10 sum = 3.2115e+10 sum = 3.2164e+10 sum = 3.2164e+10 y = 0

Suggested Problems