Winner Nicke (Revolution IV)

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

Serpent1.2

by François Glineur

Status: Passed
Results: pass
CPU Time: 0.14
Score: 326.0
Submitted at: 2003-11-06 16:31:00 UTC
Scored at: 2003-11-06 17:16:22 UTC

Current Rank: 176th
Based on: Serpent (diff)
Basis for: Serpent1.3 (diff)

Comments
Please login or create a profile.
Code
[m n]=size(a);
l = a(:, 2:n) - a(:, 1:n-1);
u = a(2:m, :) - a(1:m-1, :);
[x y]=find(l == 1);
r=y*m+x-m;
[x y]=find(l == -1);
s=y*m+x-m;
[x y]=find(u == 1);
t=y*m+x-m;
[x y]=find(u == -1);
u=y*m+x-m;
F=sparse([r;s+m;t;u+1],[r+m;s;t+1;u],1,m*n,m*n);
i=1;
G{1}=F;
while any(any(G{i}))
   i=i+1;
   G{i} = G{i-1}*F;
end % length is 
[b e] = find(G{i-1});
for j = 2:i-1
   b(j) = find(F(b(j-1),:) & G{i-j}(:, e)');
end
b(i)=e;
b=b';