Cody

# Problem 2313. Narcissistic problem

Solution 581526

Submitted on 13 Feb 2015 by Brian Moore
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
%% % this problem will be updated, % your score/size can change over time % if you submit a fixed value :-)

2   Pass
%% y=like_me(); assert(isequal(mod(y,1),0));

[Warning: Function round has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In like_me at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14]

3   Pass
%% y=like_me(); assert(y>0);

[Warning: Function round has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In like_me at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14]

4   Pass
%% y=like_me(); url='http://www.mathworks.co.uk/matlabcentral/cody/problems/2313' % the main problem with this problem is that ... % this problem thinks. % it thinks about itself most of the time. % it is convinced, that at least X likes has it. y_sub_correct=max([10 cellfun(@(S)str2num(cell2mat(S)),regexp(urlread(url),'(\d*) players</a> like this problem','tokens'))]); % probably hackable by comments? t = mtree('like_me.m','-file'); size = length(t.nodesize); % this problem likes compliments, % even false. % For good compliment it is going to pass your solution with a smaller size! % But if you don't appreciate it, it can punish you... feval(@assignin,'caller','score',round(max(0,size*(.5+.5*y_sub_correct/y))));

[Warning: Function round has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In like_me at 2 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14] url = http://www.mathworks.co.uk/matlabcentral/cody/problems/2313 [Warning: Function round has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In getCode at 22 In mtree.mtree>mtree.mtree at 118 In verifyCode>evaluateCode at 238 In verifyCode at 43 In fevalJSON at 14]