Pagini recente » Cod sursa (job #2033834) | Cod sursa (job #544904) | Cod sursa (job #3128323) | Cod sursa (job #1481836) | Cod sursa (job #136060)
Cod sursa(job #136060)
var a:array[0..100000] of int64;
crr,max:int64;
i,j,start,stop,n:longint;
f,g:text;
begin
assign(f,'xormax.in');
assign(g,'xormax.out');
reset(f);
rewrite(g);
read(f,n);
for i:=1 to n do begin
read(f,crr);
a[i]:=a[i-1] xor crr;
end;
for i:=1 to n do
if a[i]>max then begin
max:=a[i];
start:=1;
stop:=i;
end;
for i:=2 to n do
for j:=i to n do
if a[j] xor a[i-1]>max then begin
max:=a[j] xor a[i-1];
start:=i;
stop:=j;
end;
writeln(g,max,' ',start,' ',stop);
close(f);
close(g);
end.