Pagini recente » Cod sursa (job #2248220) | Cod sursa (job #1986467) | Cod sursa (job #207368) | Cod sursa (job #2756072) | Cod sursa (job #157787)
Cod sursa(job #157787)
program xormax;
var a:array[0..1,1..1000]of longint;
i,j,poz,n,max,start,stop,x:longint;
f:text;
begin
assign(f,'xormax.in'); reset(f);
readln(f,n);
max:=0;
for i:=1 to n do begin
read(f,x);
poz:=i mod 2;
for j:=1 to i do begin
a[poz,j]:=a[1-poz,j] xor x;
if a[poz,j]>max then begin
max:=a[poz,j];
start := j;
stop := i;
end;
end;
end;
close(f);
assign(f,'xormax.out'); rewrite(f);
writeln(f,max,' ',start,' ',stop);
close(f);
end.