Cody

Solution 177398

Submitted on 14 Dec 2012
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
feval(@assignin,'caller','score',1000);
2   Pass
%% urlwrite('http://contest.usc.edu/index.php/Fall12/Home?action=download&upname=pits.in.txt','pits.in.txt');
3   Fail
%% fid=fopen('pits.in.txt','r'); t_expect=[19 2 2 3 -1 7 14 23 401 200 42 -1 27 -1]; t1=0; qty=fscanf(fid,'%i',1); for q=1:qty %qty n = fscanf(fid,'%f %f\n',2)'; % array size A=zeros(n); for i=1:n(1) strv=fgetl(fid); %A(i,:)=strv-'.'; A(i,:)=strv; end ta=clock; [t]=Pits(char(A)) ; t1=t1+etime(clock,ta)*1000; % Time in msec fprintf('%2i Cmds %3.0f Sum Time %.0f \n',q,t,t1) %isequal(t,t_expect(q)) assert(isequal(t,t_expect(q))); end % q t2=min(1000,t1); fprintf('Actual Time = %.1f msec\n',t1) feval(@assignin,'caller','score',floor(t2));
Error: Assertion failed.