Pagini recente » Cod sursa (job #2923462) | Cod sursa (job #1103442) | Cod sursa (job #2346371) | Cod sursa (job #1240289) | Cod sursa (job #303235)
Cod sursa(job #303235)
#include <stdio.h>
int main()
{long x,n,i,st,stt,stp,y,max,s;
freopen("xormax.in","r",stdin);
freopen("xormax.out","w",stdout);
scanf("%ld",&n);scanf("%ld",&s);st=1;max=s;stt=1;stp=1;
for (i=2;i<=n;i++)
{scanf("%ld",&x);
if (x>(s^x)) {s=x;st=i;} else s=s^x;
if (s>max) {max=s;stt=st;stp=i;}
}
printf("%ld %ld %ld\n",max,stt,stp);
return 0;
}