Winner Markus (ones 8)

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

beat obfuscation

by Jack Snoeyink

Status: Passed
Results: 52395.56 (cyc: 17)
CPU Time: 64.1297
Score: 5295.94
Submitted at: 2007-11-14 09:23:19 UTC
Scored at: 2007-11-14 09:27:18 UTC

Current Rank: 515th
Based on: Any Good ? (diff)

Comments
Jack Snoeyink
14 Nov 2007
Maybe the way to combat obfuscators is to make mods to beat them with their own code...
Please login or create a profile.
Code
function L50 = solver(DKS,XwB,ZyK), OTp = 2; ss = sort(DKS); [st,tx] = sort(XwB); XwB(tx)=(st+ss)/2; if ZyK > OTp, L50 = D5L(DKS,XwB,ZyK-OTp);YDA = CiS(doMoves(DKS,L50,length(DKS)),XwB,ZyK-size(L50,1));
GXt = SCe(doMoves(DKS,L50,length(DKS)),XwB,ZyK-size(L50,1),YDA);Cqz = Kv5(doMoves(DKS,L50,length(DKS)),XwB,ZyK-size(L50,1));
LGQ = SCe(doMoves(DKS,L50,length(DKS)),XwB,ZyK-size(L50,1),Cqz);if LGQ<GXt,YDA = Cqz;
end
L50 = [L50; YDA];else, L50 = XtG(DKS,XwB,ZyK);
end
function [L50,V11] = Z_t(DKS,XwB,ZyK,XGF), L50 = zeros(ZyK,4);NoF=numel(DKS);CPo=zeros(ZyK,1);Ivs = repmat(XwB,NoF,1);Ao9=Ivs';
Hvw = repmat(DKS,NoF,1);W66=false(1,NoF);i=1;
while i<ZyK
Hvw(:,W66) = repmat(DKS(W66),NoF,1);CRF = Hvw';TlE = abs(Ao9-Hvw) + abs(CRF-Ivs) - abs(Ivs-Hvw) - abs(Ao9-CRF) ;if XGF>0
TlE = TlE.*(1 + XGF*rand(NoF));
end
[ZF9,RjD] = min(TlE);[ZF9,Bko] = min(ZF9);RjD=RjD(Bko);OkK =[RjD Bko]; RjD = min(OkK); Bko=max(OkK);LMX = TlE(RjD,Bko);PSH=RjD;Kcm=Bko;
PEH = (Kcm<NoF) * (PSH<Bko-1);
while PEH
XCK = TlE(PSH+1,Kcm+1);if XCK<0, PSH=PSH+1;Kcm=Kcm+1;LMX = LMX+XCK;
end
PEH = ~( (XCK>=0) + (Kcm==NoF) + (PSH>=Bko-1) );
end
PEH = (RjD>1 )*(PSH<Bko-1);
while PEH
XCK = TlE(RjD-1,Bko-1);if XCK<0, RjD=RjD-1;Bko=Bko-1;LMX = LMX+XCK;
end
PEH= ~((XCK>=0) + (RjD==1) + (PSH>=Bko-1) );
end
Wxi = PSH-RjD+1;QiA = [Wxi Bko RjD 0; Wxi RjD+Wxi Bko 0];Aln = TlE(RjD,Bko);PSH=RjD;Kcm=Bko;PEH = PSH<Bko-1;
while PEH
XCK = TlE(PSH+1,Bko-1);if XCK<0, PSH=PSH+1;Bko=Bko-1;Aln = Aln+XCK;
end
PEH = ~( (XCK>=0) + (PSH>=Bko-1) );
end
PEH = (RjD>1)*(PSH<Bko-1)*( Kcm<NoF);
while PEH
XCK = TlE(RjD-1,Kcm+1);if XCK<0, RjD=RjD-1;Kcm=Kcm+1;Aln = Aln+XCK;
end
PEH = ~((XCK>=0) + (RjD==1) + (Kcm==NoF));
end
Wxi = PSH-RjD+1;YDA = [Wxi Bko RjD 1; Wxi RjD+Wxi Bko 1];if LMX<=Aln, L50(i:i+1,:) = QiA;else, L50(i:i+1,:) = YDA;
end
Wxi= L50(i,1); Bko = L50(i,2); RjD=L50(i,3);D8W(1,:) = doMoves(DKS,L50(i,:),NoF);JuT(1) = sum(abs(D8W(1,:)-XwB));D8W(2,:) = doMoves(D8W(1,:),L50(i+1,:),NoF);
JuT(2) = sum(abs(D8W(2,:)-XwB));D8W(3,:) = doMoves(DKS,L50(i+1,:),NoF);JuT(3) = sum(abs(D8W(3,:)-XwB));[NKS,MKo] = min(JuT);
DKS=D8W(MKo,:);CPo(i:i+1) = JuT(1:2);if MKo==3, L50(i,:) = L50(i+1,:);CPo(i) = JuT(3);i=i+1;else, i=i+MKo;
end
W66 = false(1,NoF);W66(RjD:RjD+Wxi-1) = true;W66(Bko:Bko+Wxi-1) = true;
end
if i==ZyK, B3a = abs(DKS-XwB);[XpO,DLV]=max(B3a);[Z60,Lt0] = min(abs(XwB-DKS(DLV))) ;KBY = [1 DLV Lt0 false];DRg = doMoves(DKS,KBY,NoF);
CyS= sum(abs(DRg-XwB));[Z60,VWs] = min(abs(XwB(DLV)-DKS)) ;FFd = [1 VWs DLV false];TN3 = doMoves(DKS,FFd,NoF);R2_= sum(abs(TN3-XwB));
if CyS<R2_, L50(i,:)=KBY;DKS = DRg;else, L50(i,:)=FFd;DKS = TN3;
end
CPo(i)= sum(abs(DKS-XwB));
end
V11= CPo(ZyK) ;
return
function L50=D5L(DKS,XwB,ZyK), DRg=DKS; JuT = 67108864;Wxi = length(XwB);if Wxi < 97, QiA = XtG(DKS, XwB, ZyK);JuT = SCe(DKS, XwB, ZyK, QiA);
if JuT<=50, L50=QiA;
return
end
end
L50 = CiS(DKS, XwB, ZyK);V11 = SCe(DKS,XwB,ZyK,L50);if V11<=50
return
end
if JuT<V11,L50 = QiA;V11=JuT;
end
YDA = Kv5(DKS, XwB, ZyK);GXt = SCe(DKS,XwB,ZyK,L50);if GXt<=25, L50=YDA;
return
end
if GXt<V11,L50 = YDA;
end
CZp = doMoves(DRg,L50,Wxi);LGQ = sum(abs(CZp-XwB));Y46 = ZyK-size(L50,1);if Y46 > 0, Y7c=RSN(CZp,XwB,Y46);H9Z=doMoves(CZp,Y7c,Wxi);
KEw=sum(abs(H9Z-XwB));if KEw<LGQ, L50=[L50;Y7c];
end
end
function L50=RSN(B3a,QzU,ZyK), L50 = zeros(ZyK,4);Wxi = length(B3a);
for Nt8=1:ZyK
diff=abs(B3a-QzU);
[CED,CJ7]=sort(diff,'descend');
Hp5 = inf(4,5);
for i=1:2
K8G = abs(B3a(CJ7(i))-QzU);[HGc, ALU] = sort(K8G);
for j=1:3
[PAY, V11] = ZvJ(B3a,QzU,CJ7(i),ALU(j));if ~isempty(PAY), Hp5(i,:) = [PAY V11];
end
end
end
[FjL,Tk4]=min(Hp5(:,5));if ~isempty(Tk4), PAY=Hp5(Tk4,1:4);L50(Nt8,:) = PAY;B3a = Mie(B3a,PAY(1), PAY(2), PAY(3), PAY(4), Wxi);
else, L50 = L50(1:Nt8-1,:);
return
end
end
function L50=Kv5(TN3,ETD,ZyK), L50=zeros(ZyK,4);Wxi = length(TN3);
for i=1:ZyK
diff=abs(TN3-ETD);[JLp,CJ7]=max(diff);K8G=abs(TN3(CJ7)-ETD);[Jcs,GS9]=min(K8G);D95=ZvJ(TN3,ETD,CJ7,GS9);if ~isempty(D95)
L50(i,:) = D95;TN3=doMoves(TN3,D95,Wxi);
end
end
function [L50,INITIAL]=ZvJ(TN3,FbB,CJ7,ALU), Wxi = length(TN3);INITIAL=sum(abs(TN3-FbB));Y7c=E9J(TN3,CJ7,ALU);if isempty(Y7c)
L50=ones(0,4);else, JP4 = size(Y7c,1);FPE=zeros(JP4,Wxi);YLI=zeros(JP4,Wxi);
for i=1:JP4
FPE(i,:)=oldsplice(TN3,Y7c(i,1),Y7c(i,2),Y7c(i,3),Y7c(i,4));YLI(i,:)=FPE(i,:)-FbB;
end
YLI=sum(abs(YLI),2);[Mjh,Ype]=min(YLI);L50=Y7c(Ype,:);INITIAL=Mjh;
end
function Y7c=E9J(TN3,CJ7,ALU), if CJ7<ALU, FO6=abs(ALU-CJ7)+1;Y7c = zeros(FO6,4);
for i=1:FO6
Y7c(i,:)=[i CJ7 ALU-i+1 1];
end
FO6=min([CJ7-1,numel(TN3)-ALU])+1;PAw = zeros(FO6-1,4);
for i=2:FO6
PAw(i-1,:)=[i CJ7-i+1 ALU 1];
end
FO6=CJ7;WSJ = zeros(FO6-1,4);
for i=2:FO6
WSJ(i-1,:)=[i CJ7-i+1 ALU-i+1 0];
end
FO6=numel(TN3)-ALU+1;H5B = zeros(FO6-1,4);
for i=2:FO6
H5B(i-1,:)=[i CJ7 ALU 0];
end
elseif CJ7>=ALU, FO6=abs(ALU-CJ7)+1;Y7c = zeros(FO6,4);
for i=1:FO6
Y7c(i,:)=[i CJ7-i+1 ALU 1];
end
FO6=min([numel(TN3)-CJ7,ALU-1])+1;PAw = zeros(FO6-1,4);
for i=2:FO6
PAw(i-1,:)=[i CJ7 ALU-i+1 1];
end
FO6=numel(TN3)-CJ7+1;WSJ = zeros(FO6-1,4);
for i=2:FO6
WSJ(i-1,:)=[i CJ7 ALU 0];
end
FO6=ALU;H5B = zeros(FO6-1,4);
for i=2:FO6
H5B(i-1,:)=[i CJ7-i+1 ALU-i+1 0];
end
end
Y7c=[Y7c;PAw;WSJ;H5B];
function L50 = CiS(DKS, XwB, ZyK), Dpo=2;NZ8=DKS;Wxi = length(DKS);Ovk = zeros(Wxi, Wxi+1);KOY = Ovk;OGi = Ovk;JwB = Ovk;L50 = zeros(ZyK,4);DQW = 1;
while 1
for Du4 = 1:Wxi
CJ7 = 2:Wxi-Du4+2;Ukd = XwB(CJ7-1);JD_ = XwB(Du4:Wxi);Ovk(Du4,CJ7) = DKS(Du4:Wxi) - Ukd;KOY(Du4,CJ7) = DKS(1:Wxi-Du4+1) - JD_;
OGi(Du4,CJ7) = DKS(Wxi-Du4+1:-1:1) - Ukd;JwB(Du4,CJ7) = DKS(Wxi:-1:Du4) - JD_;
end
Ovk=cumsum(abs(Ovk),2);KOY=cumsum(abs(KOY),2);OGi=cumsum(abs(OGi),2);JwB=cumsum(abs(JwB),2);Ljt = Ovk(1,:);ZHT = Ljt(Wxi+1) - Ljt;
Jx2 = Ljt(Wxi+1);UU5 = DQW/ZyK;D5q = Jx2;SvN = [(33:4:Wxi-1), 32, 29:-1:1];SvN(SvN >= Wxi) = [];Tdy = (abs(DKS - XwB) < 1e-3)*floor(UU5);
NxV=1;X0b=1;DMD=1;P7x=false;
for NQS = SvN
Eer = Ovk(NQS+1,:);B2D = KOY(NQS+1,:);FtC = Wxi - NQS + 1;
for M9x = 1:FtC
for EHf = 1:FtC*~Tdy(M9x)
if M9x <= EHf, JuT =Ljt(M9x) + Eer(EHf) +ZHT(EHf+NQS) - Eer(M9x);else, JuT =Ljt(EHf) + B2D(M9x) + ZHT(M9x+NQS) - B2D(EHf);
end
if NQS ~= 1, FMG = Wxi-M9x-NQS+2;if EHf >= FMG, NdM = JuT +JwB(EHf - FMG + 1, FMG+NQS) -JwB(EHf - FMG + 1, FMG);else, NdM = JuT + ...
OGi(FMG - EHf + 1, EHf+NQS) -OGi(FMG - EHf + 1, EHf);
end
if NdM < Jx2, Jx2 = NdM;NxV=NQS;X0b=M9x;DMD=EHf; P7x=true;
end
end
if NQS<=Wxi/2, if M9x <= EHf, NdM = JuT +KOY(EHf-M9x+1, M9x+NQS) -KOY(EHf-M9x+1, M9x);else, NdM = JuT + Ovk(M9x-EHf+1, EHf+NQS) -Ovk(M9x-EHf+1, EHf);
end
if NdM < Jx2, Jx2 = NdM;NxV=NQS;X0b=M9x;DMD=EHf;P7x=false;
end
end
end
end
end
L50(DQW,:)=[NxV X0b DMD P7x];DKS = Mie(DKS, NxV, X0b, DMD, P7x, Wxi);Dpo=Dpo-1;if Dpo<=0
for QTc = 1:2;
XGF = (QTc>1)*0.8;DRg = CyW(NZ8,L50,DQW-2);[THc,V11]=Z_t(DRg,XwB,2,XGF);if V11 < Jx2, L50(DQW-1:DQW,:) = THc;Jx2 = V11;DKS = CyW(DRg,THc,2);
Dpo=2;
end
end
end
DQW = DQW + 1;if (DQW > ZyK)+(D5q==Jx2), L50 = L50(1:DQW-1,:);
return
end
end
function Kl_ = SCe(DKS,XwB,ZyK,L50), TZ1 = CyW(DKS,L50,ZyK);Kl_ = sum(abs(TZ1-XwB));
function TZ1 = CyW(TZ1,L50,ZyK), if size(L50,1)>ZyK, L50 = L50(1:ZyK,:);
end
Glj = numel(TZ1);L50(:,1) = max(1,min(Glj,L50(:,1)));L50(:,2) = max(1,min(Glj-L50(:,1)+1,L50(:,2)));L50(:,3) = max(1,min(Glj-L50(:,1)+1,L50(:,3)));
L50(:,4) = L50(:,4) ~= 0;
for i =1:size(L50,1)
le = L50(i,1);Au9 = L50(i,2);Aez = L50(i,3);GBM = L50(i,4);if GBM, if Au9>Aez
TZ1 = TZ1([1:Aez-1 Au9+le-1:-1:Au9 Aez:Au9-1 Au9+le:end]);
else
TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9+le-1:-1:Au9 Aez+le:end]);
end
else, if Au9>Aez
TZ1 = TZ1([1:Aez-1 Au9:Au9+le-1 Aez:Au9-1 Au9+le:end]);
else
TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9:Au9+le-1 Aez+le:end]);
end
end
end
function L50 = XtG(DKS, XwB, ZyK), NZ8=DKS;JCM = [14 12 9 8 7];LHg = [0.9 0.6 0.3 0.1 -1];Wxi = length(DKS);CJ7 = JCM > Wxi;
JCM(CJ7) = [];LHg(CJ7) = [];Ovk = zeros(Wxi, Wxi+1);KOY = Ovk;OGi = Ovk;JwB = Ovk;L50 = zeros(ZyK,4);DQW = 1;
while DQW <= ZyK
for Du4 = 1:Wxi
CJ7 = 2:Wxi-Du4+2;Ukd = XwB(CJ7-1);JD_ = XwB(Du4:Wxi);Ovk(Du4,CJ7) = DKS(Du4:Wxi) - Ukd;KOY(Du4,CJ7) = DKS(1:Wxi-Du4+1) - JD_;
OGi(Du4,CJ7) = DKS(Wxi-Du4+1:-1:1) - Ukd;JwB(Du4,CJ7) = DKS(Wxi:-1:Du4) - JD_;
end
Ovk=cumsum(abs(Ovk),2);KOY=cumsum(abs(KOY),2);OGi=cumsum(abs(OGi),2);JwB=cumsum(abs(JwB),2);Ljt = Ovk(1,:);ZHT = Ljt(Wxi+1) - Ljt;
Jx2 = Ljt(Wxi+1);D5q=Jx2;UU5 = 1 - DQW / ZyK;BEf = find(UU5 >= LHg, 1, 'first');R74 = JCM(BEf);SvN = [31:-2:21 R74+4 R74+3 R74+2 R74 6 5 4 3 2 1];
SvN(SvN >= Wxi) = [];SvN = fliplr(unique(SvN));Tdy = (abs(DKS - XwB) < 1e-3)*round(UU5-0.3);NxV=1;X0b=1;DMD=1;P7x=false;
for NQS = SvN
Eer = Ovk(NQS+1,:);B2D = KOY(NQS+1,:);FtC = Wxi - NQS + 1;
for M9x = 1:FtC
for EHf = 1:(M9x-1)*~Tdy(M9x)
JuT =Ljt(EHf) + B2D(M9x) +ZHT(M9x+NQS) - B2D(EHf);if NQS == 1, NdM=JuT+Ovk(M9x-EHf+1, EHf+NQS) -Ovk(M9x-EHf+1, EHf);else
FMG = Wxi-M9x-NQS+2;if EHf >= FMG, NdM = JuT +JwB(EHf - FMG + 1, FMG+NQS) -JwB(EHf - FMG + 1, FMG);else, NdM = JuT +OGi(FMG - EHf + 1, EHf+NQS) -OGi(FMG - EHf + 1, EHf);
end
end
if NdM < Jx2, Jx2 = NdM;NxV=NQS;X0b=M9x;DMD=EHf;P7x=true;
end
end
for EHf = M9x:FtC
JuT =Ljt(M9x) + Eer(EHf) +ZHT(EHf+NQS) - Eer(M9x);if NQS == 1, NdM = JuT +KOY(EHf-M9x+1, M9x+NQS) -KOY(EHf-M9x+1, M9x);else
FMG = Wxi-M9x-NQS+2;if EHf >= FMG, NdM = JuT +JwB(EHf - FMG + 1, FMG+NQS) -JwB(EHf - FMG + 1, FMG);else, NdM = JuT +OGi(FMG - EHf + 1, EHf+NQS) -OGi(FMG - EHf + 1, EHf);
end
end
if NdM < Jx2, Jx2 = NdM;NxV=NQS;X0b=M9x;DMD=EHf;P7x=true;
end
end
end
end
L50(DQW,:)=[NxV X0b DMD P7x];DKS = Mie(DKS, NxV, X0b, DMD, P7x, Wxi);if DQW>1
for QTc = 1:2
XGF = (QTc>1)*0.15;DRg = CyW(NZ8,L50,DQW-2);[THc,V11]=Z_t(DRg,XwB,2,XGF);if V11 < Jx2, L50(DQW-1:DQW,:) = THc;Jx2 = V11;DKS = CyW(DRg,THc,2);
end
end
end
DQW = DQW + 1;if (DQW > ZyK)+(D5q==Jx2), L50 = L50(1:DQW-1,:);
return
end
end
function TZ1 = oldsplice(TZ1, le, Au9, Aez, GBM), if GBM, if Au9>Aez
TZ1 = TZ1([1:Aez-1 Au9+le-1:-1:Au9 Aez:Au9-1 Au9+le:end]);
else
TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9+le-1:-1:Au9 Aez+le:end]);
end
else, if Au9>Aez
TZ1 = TZ1([1:Aez-1 Au9:Au9+le-1 Aez:Au9-1 Au9+le:end]);
else
TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9:Au9+le-1 Aez+le:end]);
end
end
function TZ1 = Mie(TZ1, le, Au9, Aez, GBM, Wxi), if GBM, if Au9>Aez, TZ1 = TZ1([1:Aez-1 Au9+le-1:-1:Au9 Aez:Au9-1 Au9+le:Wxi]);
else, TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9+le-1:-1:Au9 Aez+le:Wxi]);
end
else, if Au9>Aez, TZ1 = TZ1([1:Aez-1 Au9:Au9+le-1 Aez:Au9-1 Au9+le:Wxi]);else, TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9:Au9+le-1 Aez+le:Wxi]);
end
end
function TZ1 = doMoves(TZ1,L50,Wxi)
for i =1:size(L50,1)
le = L50(i,1);Au9 = L50(i,2);Aez = L50(i,3);if L50(i,4), if Au9>Aez, TZ1 = TZ1([1:Aez-1 Au9+le-1:-1:Au9 Aez:Au9-1 Au9+le:Wxi]);
else, TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9+le-1:-1:Au9 Aez+le:Wxi]);
end
else, if Au9>Aez, TZ1 = TZ1([1:Aez-1 Au9:Au9+le-1 Aez:Au9-1 Au9+le:Wxi]);else, TZ1 = TZ1([1:Au9-1 Au9+le:Aez+le-1 Au9:Au9+le-1 Aez+le:Wxi]);
end
end
end