Winner Nicke (Revolution IV)

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

transpose 12

by Martijn

Status: Passed
Results: pass
CPU Time: 39.748
Score: 226.0
Submitted at: 2003-11-06 17:29:49 UTC
Scored at: 2003-11-06 19:22:30 UTC

Current Rank: 14th
Based on: transpose 11 (diff)
Basis for: blah 3 (diff)
Basis for: st5f (diff)
Basis for: 19.1th try! (diff)
...and 2 others.

Comments
Please login or create a profile.
Code
[n m]=size(a);
z=n*m;
r = 1:z;
p=num2cell(r);
for i=r
    for k=r
        e=p{k}(end);
        h = a(e)+1;
        g = e-1;
        w = e+n;
        f = mod(g,n);
        y = [ ];
        if w<=z & a(w)==h
            y = w;
        elseif e>n & a(e-n)==h
            y = e-n;
        elseif f<n-1 & a(e+1)==h
            y = e+1;
        elseif f>0 & a(g)==h
            y = g;
        end
        p{k} = [ p{k}; y ];
        d(k) = nnz(p{k});
    end
end
b = p{d==max(d)}