Finish 2003-11-13 10:00:00 UTC

testsh_04

by Stijn Helsen

Status: Passed
Results: pass
CPU Time: 29.022
Score: 249.0
Submitted at: 2003-11-06 11:37:43 UTC
Scored at: 2003-11-06 12:23:50 UTC

Current Rank: 96th
Based on: Finally? (diff)
Basis for: minor change (diff)

Comments
Stijn Helsen
06 Nov 2003
stupid change
Please login or create a profile.
Code
n = size(a, 1);
s = {1};
D = Inf*(1:n);
P = cell(1,n);
while numel(s)
   p = s{end};
   s(end)=[];
   t = a(p(end),:);
   k = setdiff(find(t), p);
   for q = k
      r = [p q];
      s{end+1} = r;
      d = 0;
      for i = 2:numel(r)
         d = d + norm(b(r(i),:) - b(r(i-1),:));
      end
      if d < D(r(end))
         D(r(end)) = d;
         P{r(end)} = r;
      end
   end
end

D(isinf(D))=0;
[i j]=max(D);
c=P{j};