Pagini recente » Cod sursa (job #1585662) | Cod sursa (job #1205398) | Cod sursa (job #708587) | Cod sursa (job #924018) | Cod sursa (job #749491)
Cod sursa(job #749491)
Program p1;
var a,c1,c2,poz,i,j1,j2,n,max,s:longint;
bufi,bufa:array[0..1 shl 23] of char;
begin
assign(input,'xormax.in'); reset(input);
assign(output,'xormax.out'); rewrite(output);
settextbuf(input,bufi); settextbuf(output,bufa);
readln(n); read(a); s:=a; j1:=1; j2:=1; c1:=s; c2:=s;
for i:=2 to n do begin
read(a);
if (c1 xor a)>=a then c2:=c1 xor a
else begin c2:=a; j1:=i; end;
if c2>s then begin s:=c2; j2:=i; poz:=j1; end;
c1:=c2;
end;
write(s,' ',poz,' ',j2);
close(input); close(output);
end.