Finish 2012-11-07 16:00:00 UTC

Tibia

by Pavan

Status: Passed
Results: 23893 (cyc: 2, node: 137)
CPU Time: 41.967
Score: 23899.5
Submitted at: 2012-10-31 17:36:40 UTC
Scored at: 2012-11-01 14:37:59 UTC

Current Rank: 1614th (Highest: 1st )
Basis for: Fibula (diff)
Basis for: Patella (diff)
Basis for: Femur (diff)
...and 3 others.

Comments
Please login or create a profile.
Code
function xyOut = solver(a, xyIn, wts)

xyIn = xyIn*100;
for z = 1:50
   xyIn = round(cell2mat(cellfun(@(a_row) mean(xyIn(a_row==1, :), 1), num2cell(a, 1), 'uni', false)'));
   tweak_overlap
end

xyOut = xyIn;

    function tweak_overlap
        [u I J] = unique(xyIn, 'rows');
        n = size(xyIn, 1) - size(u, 1);
        while(n>0)
            xyIn(setdiff(1:length(xyIn), I), :) = xyIn(setdiff(1:length(xyIn), I), :) + ones(n, 2);
            [u I J] = unique(xyIn, 'rows');
            n = size(xyIn, 1) - size(u, 1);
        end
    end

end