Peak Detection by 51b

a[];*i,*j,*k,y;f(x){for(y=0,k=j;k>a&(k+=x)<i&*k<*j;)y|=*k+9<*j;}main(z){for(i=j=k=a;~scanf("%d",i)?++i:j<i?f(1),z=y,f(-1),printf("%d%s\n",*j++,"\x00*"+z*y):0;);}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page