Winner Markus (ones 8)

Finish 2007-11-14 12:00:00 UTC

Anti-obfuscation

by Abhisek Ukil

Status: Passed
Results: 51380.94 (cyc: 17)
CPU Time: 63.78
Score: 5193.62
Submitted at: 2007-11-14 09:46:40 UTC
Scored at: 2007-11-14 09:53:45 UTC

Current Rank: 127th
Basis for: obfrustration (diff)

Comments
Abhisek Ukil
14 Nov 2007
Can obfuscation really hide originality?
Please login or create a profile.
Code
function Iav = solver(CYQ,DgS,WRh), EN1 = 2;if WRh > EN1, Iav = G_J(CYQ,DgS,WRh-EN1);WBQ = Al1(doMoves(CYQ,Iav,length(CYQ)),DgS,WRh-size(Iav,1));
    AyD = C13(doMoves(CYQ,Iav,length(CYQ)),DgS,WRh-size(Iav,1),WBQ);O3X = Cts(doMoves(CYQ,Iav,length(CYQ)),DgS,WRh-size(Iav,1));
    YFA = C13(doMoves(CYQ,Iav,length(CYQ)),DgS,WRh-size(Iav,1),O3X);if YFA<AyD,WBQ = O3X;
    end
    Iav = [Iav; WBQ];else, Iav = U4u(CYQ,DgS,WRh);
end
function [Iav,Bfq] = RLh(CYQ,DgS,WRh,To3), Iav = zeros(WRh,4);USa=numel(CYQ);DOl=zeros(WRh,1);UHh = repmat(DgS,USa,1);FXu=UHh';
DM7 = repmat(CYQ,USa,1);Y_P=false(1,USa);i=1;
while i<WRh
    DM7(:,Y_P) = repmat(CYQ(Y_P),USa,1);Tb5 = DM7';Dm1 = abs(FXu-DM7) + abs(Tb5-UHh) - abs(UHh-DM7) - abs(FXu-Tb5) ;if To3>0
        Dm1 = Dm1.*(1 + To3*rand(USa));
    end
    [JdZ,X4U] = min(Dm1);[JdZ,Db5] = min(JdZ);X4U=X4U(Db5);CLn =[X4U Db5]; X4U = min(CLn); Db5=max(CLn);Hzh = Dm1(X4U,Db5);DvM=X4U;Xd9=Db5;
    J6_ = (Xd9<USa) * (DvM<Db5-1);
    while J6_
        Esu = Dm1(DvM+1,Xd9+1);if Esu<0, DvM=DvM+1;Xd9=Xd9+1;Hzh = Hzh+Esu;
        end
        J6_ = ~( (Esu>=0) + (Xd9==USa) + (DvM>=Db5-1) );
    end
    J6_ = (X4U>1 )*(DvM<Db5-1);
    while J6_
        Esu = Dm1(X4U-1,Db5-1);if Esu<0, X4U=X4U-1;Db5=Db5-1;Hzh = Hzh+Esu;
        end
        J6_= ~((Esu>=0) + (X4U==1) + (DvM>=Db5-1) );
    end
    FeI = DvM-X4U+1;TfS = [FeI Db5 X4U 0; FeI X4U+FeI Db5 0];WEE = Dm1(X4U,Db5);DvM=X4U;Xd9=Db5;J6_ = DvM<Db5-1;
    while J6_
        Esu = Dm1(DvM+1,Db5-1);if Esu<0, DvM=DvM+1;Db5=Db5-1;WEE = WEE+Esu;
        end
        J6_ = ~( (Esu>=0) + (DvM>=Db5-1) );
    end
    J6_ = (X4U>1)*(DvM<Db5-1)*( Xd9<USa);
    while J6_
        Esu = Dm1(X4U-1,Xd9+1);if Esu<0, X4U=X4U-1;Xd9=Xd9+1;WEE = WEE+Esu;
        end
        J6_ = ~((Esu>=0) + (X4U==1) + (Xd9==USa));
    end
    FeI = DvM-X4U+1;WBQ = [FeI Db5 X4U 1; FeI X4U+FeI Db5 1];if Hzh<=WEE, Iav(i:i+1,:) = TfS;else, Iav(i:i+1,:) = WBQ;
    end
    FeI= Iav(i,1); Db5 = Iav(i,2); X4U=Iav(i,3);P43(1,:) = doMoves(CYQ,Iav(i,:),USa);Rif(1) = sum(abs(P43(1,:)-DgS));P43(2,:) = doMoves(P43(1,:),Iav(i+1,:),USa);
    Rif(2) = sum(abs(P43(2,:)-DgS));P43(3,:) = doMoves(CYQ,Iav(i+1,:),USa);Rif(3) = sum(abs(P43(3,:)-DgS));[M3K,O4W] = min(Rif);
    CYQ=P43(O4W,:);DOl(i:i+1) = Rif(1:2);if O4W==3, Iav(i,:) = Iav(i+1,:);DOl(i) = Rif(3);i=i+1;else, i=i+O4W;
    end
    Y_P = false(1,USa);Y_P(X4U:X4U+FeI-1) = true;Y_P(Db5:Db5+FeI-1) = true;
end
if i==WRh, Z9A = abs(CYQ-DgS);[Z80,XDJ]=max(Z9A);[SSm,SOU] = min(abs(DgS-CYQ(XDJ))) ;RkP = [1 XDJ SOU false];WM3 = doMoves(CYQ,RkP,USa);
    KWx= sum(abs(WM3-DgS));[SSm,XNv] = min(abs(DgS(XDJ)-CYQ)) ;T0n = [1 XNv XDJ false];ZAY = doMoves(CYQ,T0n,USa);JOZ= sum(abs(ZAY-DgS));
    if KWx<JOZ, Iav(i,:)=RkP;CYQ = WM3;else, Iav(i,:)=T0n;CYQ = ZAY;
    end
    DOl(i)= sum(abs(CYQ-DgS));
end
Bfq= DOl(WRh) ;
return
function Iav=G_J(CYQ,DgS,WRh), WM3=CYQ; Rif = 67108864;FeI = length(DgS);if FeI < 97, TfS = U4u(CYQ, DgS, WRh);Rif = C13(CYQ, DgS, WRh, TfS);
    if Rif<=50, Iav=TfS;
        return
    end
end
Iav = Al1(CYQ, DgS, WRh);Bfq = C13(CYQ,DgS,WRh,Iav);if Bfq<=50
    return
end
if Rif<Bfq,Iav = TfS;Bfq=Rif;
end
WBQ = Cts(CYQ, DgS, WRh);AyD = C13(CYQ,DgS,WRh,Iav);if AyD<=25, Iav=WBQ;
    return
end
if AyD<Bfq,Iav = WBQ;
end
WxF = doMoves(WM3,Iav,FeI);YFA = sum(abs(WxF-DgS));TiD = WRh-size(Iav,1);if TiD > 0, XWt=OLv(WxF,DgS,TiD);B1l=doMoves(WxF,XWt,FeI);
    DU4=sum(abs(B1l-DgS));if DU4<YFA, Iav=[Iav;XWt];
    end
end
function Iav=OLv(Z9A,RYl,WRh), Iav = zeros(WRh,4);FeI = length(Z9A);
for MDg=1:WRh
    diff=abs(Z9A-RYl);
    [XKH,KQH]=sort(diff,'descend');
    QO0 = inf(4,5);
    for i=1:2
        YPb = abs(Z9A(KQH(i))-RYl);[GZS, Gkh] = sort(YPb);
        for j=1:3
            [HI9, Bfq] = B02(Z9A,RYl,KQH(i),Gkh(j));if ~isempty(HI9), QO0(i,:) = [HI9 Bfq];
            end
        end
    end
    [OGe,Aml]=min(QO0(:,5));if ~isempty(Aml), HI9=QO0(Aml,1:4);Iav(MDg,:) = HI9;Z9A = H8J(Z9A,HI9(1), HI9(2), HI9(3), HI9(4), FeI);
    else, Iav = Iav(1:MDg-1,:);
        return
    end
end
function Iav=Cts(ZAY,T42,WRh), Iav=zeros(WRh,4);FeI = length(ZAY);
for i=1:WRh
    diff=abs(ZAY-T42);[LP0,KQH]=max(diff);YPb=abs(ZAY(KQH)-T42);[RFg,Ovd]=min(YPb);TK0=B02(ZAY,T42,KQH,Ovd);if ~isempty(TK0)
        Iav(i,:) = TK0;ZAY=doMoves(ZAY,TK0,FeI);
    end
end
function [Iav,INITIAL]=B02(ZAY,Wfn,KQH,Gkh), FeI = length(ZAY);INITIAL=sum(abs(ZAY-Wfn));XWt=OC3(ZAY,KQH,Gkh);if isempty(XWt)
    Iav=ones(0,4);else, Zzw = size(XWt,1);XGt=zeros(Zzw,FeI);CqL=zeros(Zzw,FeI);
    for i=1:Zzw
        XGt(i,:)=oldsplice(ZAY,XWt(i,1),XWt(i,2),XWt(i,3),XWt(i,4));CqL(i,:)=XGt(i,:)-Wfn;
    end
    CqL=sum(abs(CqL),2);[TTd,JA_]=min(CqL);Iav=XWt(JA_,:);INITIAL=TTd;
end
function XWt=OC3(ZAY,KQH,Gkh), if KQH<Gkh, V3o=abs(Gkh-KQH)+1;JW9 = (1:V3o)';Hze = ones(V3o,1);UXU = [JW9 KQH*Hze (Gkh+1)-JW9 Hze];
    V3o=min([KQH-1,numel(ZAY)-Gkh])+1;JW9 = (2:V3o)';Hze = ones(V3o-1,1);J7E = [JW9 (KQH+1)-JW9 Gkh*Hze Hze];V3o=KQH;JW9 = (2:V3o)';
    HBt = zeros(V3o-1,1);Zmx = [JW9 (KQH+1)-JW9 (Gkh+1)-JW9 HBt];V3o=numel(ZAY)-Gkh+1;JW9 = (2:V3o)';HBt = zeros(V3o-1,1);XWt=[UXU;J7E;Zmx;[JW9 KQH+HBt Gkh+HBt HBt]];
elseif KQH>=Gkh, V3o=abs(Gkh-KQH)+1;V3o=V3o+min([numel(ZAY)-KQH,Gkh-1]);JW9 = (1:V3o)';Hze = ones(V3o,1);UXU = [JW9 (KQH+1)-JW9 Gkh*Hze Hze];V3o=min([numel(ZAY)-KQH,Gkh-1])+1;
    JW9 = (2:V3o)';Hze = ones(V3o-1,1);J7E = [JW9 KQH*Hze (Gkh+1)-JW9 Hze];V3o=numel(ZAY)-KQH+1;JW9 = (2:V3o)';HBt = zeros(V3o-1,1);
    Zmx = [JW9 KQH+HBt Gkh+HBt HBt];V3o=Gkh;JW9 = (2:V3o)';HBt = zeros(V3o-1,1);XWt=[UXU;J7E;Zmx;[JW9 (KQH+1)-JW9 (Gkh+1)-JW9 HBt]];
end
function Iav = Al1(CYQ, DgS, WRh), X99=2;UjG=CYQ;FeI = length(CYQ);Yi5 = zeros(FeI, FeI+1);YJf = Yi5;J_6 = Yi5;GPM = Yi5;Iav = zeros(WRh,4);Wsq = 1;
while 1
    for QDi = 1:FeI
        KQH = 2:FeI-QDi+2;Fkk = DgS(KQH-1);QKS = DgS(QDi:FeI);Yi5(QDi,KQH) = CYQ(QDi:FeI) - Fkk;YJf(QDi,KQH) = CYQ(1:FeI-QDi+1) - QKS;
        J_6(QDi,KQH) = CYQ(FeI-QDi+1:-1:1) - Fkk;GPM(QDi,KQH) = CYQ(FeI:-1:QDi) - QKS;
    end
    Yi5=cumsum(abs(Yi5),2);YJf=cumsum(abs(YJf),2);J_6=cumsum(abs(J_6),2);GPM=cumsum(abs(GPM),2);DSB = Yi5(1,:);ICQ = DSB(FeI+1) - DSB;
    IdC = DSB(FeI+1);Ioi = Wsq/WRh;Icv = IdC;CNf = [(33:4:FeI-1), 32, 29:-1:1];CNf(CNf >= FeI) = [];SfT = (abs(CYQ - DgS) < 1e-3)*floor(Ioi);
    ZWc=1;Fy5=1;FbT=1;MNr=false;
    for Dq0 = CNf
        GXh = Yi5(Dq0+1,:);Bz5 = YJf(Dq0+1,:);VUa = FeI - Dq0 + 1;
        for B4O = 1:VUa
            for ZHN = 1:VUa*~SfT(B4O)
                if B4O <= ZHN, Rif =DSB(B4O) + GXh(ZHN) +ICQ(ZHN+Dq0) - GXh(B4O);else, Rif =DSB(ZHN) + Bz5(B4O) + ICQ(B4O+Dq0) - Bz5(ZHN);
                end
                if Dq0 ~= 1, Daa = FeI-B4O-Dq0+2;if ZHN >= Daa, J15 = Rif +GPM(ZHN - Daa + 1, Daa+Dq0) -GPM(ZHN - Daa + 1, Daa);else, J15 = Rif + ...
                            J_6(Daa - ZHN + 1, ZHN+Dq0) -J_6(Daa - ZHN + 1, ZHN);
                    end
                    if J15 < IdC, IdC = J15;ZWc=Dq0;Fy5=B4O;FbT=ZHN; MNr=true;
                    end
                end
                if Dq0<=FeI/2, if B4O <= ZHN, J15 = Rif +YJf(ZHN-B4O+1, B4O+Dq0) -YJf(ZHN-B4O+1, B4O);else, J15 = Rif + Yi5(B4O-ZHN+1, ZHN+Dq0) -Yi5(B4O-ZHN+1, ZHN);
                    end
                    if J15 < IdC, IdC = J15;ZWc=Dq0;Fy5=B4O;FbT=ZHN;MNr=false;
                    end
                end
            end
        end
    end
    Iav(Wsq,:)=[ZWc Fy5 FbT MNr];CYQ = H8J(CYQ, ZWc, Fy5, FbT, MNr, FeI);X99=X99-1;if X99<=0
        for ZCO = 1:2;
            To3 = (ZCO>1)*0.8;WM3 = JL0(UjG,Iav,Wsq-2);[Gta,Bfq]=RLh(WM3,DgS,2,To3);if Bfq < IdC, Iav(Wsq-1:Wsq,:) = Gta;IdC = Bfq;CYQ = JL0(WM3,Gta,2);
                X99=2;
            end
        end
    end
    Wsq = Wsq + 1;if (Wsq > WRh)+(Icv==IdC), Iav = Iav(1:Wsq-1,:);
        return
    end
end
function GPf = C13(CYQ,DgS,WRh,Iav), TLC = JL0(CYQ,Iav,WRh);GPf = sum(abs(TLC-DgS));
function TLC = JL0(TLC,Iav,WRh), if size(Iav,1)>WRh, Iav = Iav(1:WRh,:);
end
UP9 = numel(TLC);Iav(:,1) = max(1,min(UP9,Iav(:,1)));Iav(:,2) = max(1,min(UP9-Iav(:,1)+1,Iav(:,2)));Iav(:,3) = max(1,min(UP9-Iav(:,1)+1,Iav(:,3)));
Iav(:,4) = Iav(:,4) ~= 0;
for i =1:size(Iav,1)
    le = Iav(i,1);Px6 = Iav(i,2);CzG = Iav(i,3);E17 = Iav(i,4);if E17, if Px6>CzG
            TLC = TLC([1:CzG-1 Px6+le-1:-1:Px6 CzG:Px6-1 Px6+le:end]);
        else
            TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6+le-1:-1:Px6 CzG+le:end]);
        end
    else, if Px6>CzG
            TLC = TLC([1:CzG-1 Px6:Px6+le-1 CzG:Px6-1 Px6+le:end]);
        else
            TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6:Px6+le-1 CzG+le:end]);
        end
    end
end
function Iav = U4u(CYQ, DgS, WRh), UjG=CYQ;GDv = [17 12 9 8 7];CBy = [0.9 0.6 0.3 0.1 -1];FeI = length(CYQ);KQH = GDv > FeI;
GDv(KQH) = [];CBy(KQH) = [];Yi5 = zeros(FeI, FeI+1);YJf = Yi5;J_6 = Yi5;GPM = Yi5;Iav = zeros(WRh,4);Wsq = 1;
while Wsq <= WRh
    for QDi = 1:FeI
        KQH = 2:FeI-QDi+2;Fkk = DgS(KQH-1);QKS = DgS(QDi:FeI);Yi5(QDi,KQH) = CYQ(QDi:FeI) - Fkk;YJf(QDi,KQH) = CYQ(1:FeI-QDi+1) - QKS;
        J_6(QDi,KQH) = CYQ(FeI-QDi+1:-1:1) - Fkk;GPM(QDi,KQH) = CYQ(FeI:-1:QDi) - QKS;
    end
    Yi5=cumsum(abs(Yi5),2);YJf=cumsum(abs(YJf),2);J_6=cumsum(abs(J_6),2);GPM=cumsum(abs(GPM),2);DSB = Yi5(1,:);ICQ = DSB(FeI+1) - DSB;
    IdC = DSB(FeI+1);Icv=IdC;Ioi = 1 - Wsq / WRh;FBO = find(Ioi >= CBy, 1, 'first');KBh = GDv(FBO);CNf = [31:-2:21 KBh+4 KBh+3 KBh+2 KBh 6 5 4 3 2 1];
    CNf(CNf >= FeI) = [];CNf = fliplr(unique(CNf));SfT = (abs(CYQ - DgS) < 1e-3)*round(Ioi-0.3);ZWc=1;Fy5=1;FbT=1;MNr=false;
    for Dq0 = CNf
        GXh = Yi5(Dq0+1,:);Bz5 = YJf(Dq0+1,:);VUa = FeI - Dq0 + 1;
        for B4O = 1:VUa
            for ZHN = 1:(B4O-1)*~SfT(B4O)
                Rif =DSB(ZHN) + Bz5(B4O) +ICQ(B4O+Dq0) - Bz5(ZHN);if Dq0 == 1, J15=Rif+Yi5(B4O-ZHN+1, ZHN+Dq0) -Yi5(B4O-ZHN+1, ZHN);else
                    Daa = FeI-B4O-Dq0+2;if ZHN >= Daa, J15 = Rif +GPM(ZHN - Daa + 1, Daa+Dq0) -GPM(ZHN - Daa + 1, Daa);else, J15 = Rif +J_6(Daa - ZHN + 1, ZHN+Dq0) -J_6(Daa - ZHN + 1, ZHN);
                    end
                end
                if J15 < IdC, IdC = J15;ZWc=Dq0;Fy5=B4O;FbT=ZHN;MNr=true;
                end
            end
            for ZHN = B4O:VUa
                Rif =DSB(B4O) + GXh(ZHN) +ICQ(ZHN+Dq0) - GXh(B4O);if Dq0 == 1, J15 = Rif +YJf(ZHN-B4O+1, B4O+Dq0) -YJf(ZHN-B4O+1, B4O);else
                    Daa = FeI-B4O-Dq0+2;if ZHN >= Daa, J15 = Rif +GPM(ZHN - Daa + 1, Daa+Dq0) -GPM(ZHN - Daa + 1, Daa);else, J15 = Rif +J_6(Daa - ZHN + 1, ZHN+Dq0) -J_6(Daa - ZHN + 1, ZHN);
                    end
                end
                if J15 < IdC, IdC = J15;ZWc=Dq0;Fy5=B4O;FbT=ZHN;MNr=true;
                end
            end
        end
    end
    Iav(Wsq,:)=[ZWc Fy5 FbT MNr];CYQ = H8J(CYQ, ZWc, Fy5, FbT, MNr, FeI);if Wsq>1
        for ZCO = 1:2
            To3 = (ZCO>1)*0.15;WM3 = JL0(UjG,Iav,Wsq-2);[Gta,Bfq]=RLh(WM3,DgS,2,To3);if Bfq < IdC, Iav(Wsq-1:Wsq,:) = Gta;IdC = Bfq;CYQ = JL0(WM3,Gta,2);
            end
        end
    end
    Wsq = Wsq + 1;if (Wsq > WRh)+(Icv==IdC), Iav = Iav(1:Wsq-1,:);
        return
    end
end
function TLC = oldsplice(TLC, le, Px6, CzG, E17), if E17, if Px6>CzG
        TLC = TLC([1:CzG-1 Px6+le-1:-1:Px6 CzG:Px6-1 Px6+le:end]);
    else
        TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6+le-1:-1:Px6 CzG+le:end]);
    end
else, if Px6>CzG
        TLC = TLC([1:CzG-1 Px6:Px6+le-1 CzG:Px6-1 Px6+le:end]);
    else
        TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6:Px6+le-1 CzG+le:end]);
    end
end
function TLC = H8J(TLC, le, Px6, CzG, E17, FeI), if E17, if Px6>CzG, TLC = TLC([1:CzG-1 Px6+le-1:-1:Px6 CzG:Px6-1 Px6+le:FeI]);
    else, TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6+le-1:-1:Px6 CzG+le:FeI]);
    end
else, if Px6>CzG, TLC = TLC([1:CzG-1 Px6:Px6+le-1 CzG:Px6-1 Px6+le:FeI]);else, TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6:Px6+le-1 CzG+le:FeI]);
    end
end
function TLC = doMoves(TLC,Iav,FeI)
for i =1:size(Iav,1)
    le = Iav(i,1);Px6 = Iav(i,2);CzG = Iav(i,3);if Iav(i,4), if Px6>CzG, TLC = TLC([1:CzG-1 Px6+le-1:-1:Px6 CzG:Px6-1 Px6+le:FeI]);
        else, TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6+le-1:-1:Px6 CzG+le:FeI]);
        end
    else, if Px6>CzG, TLC = TLC([1:CzG-1 Px6:Px6+le-1 CzG:Px6-1 Px6+le:FeI]);else, TLC = TLC([1:Px6-1 Px6+le:CzG+le-1 Px6:Px6+le-1 CzG+le:FeI]);
        end
    end
end