Peak Detection by 51b

import std.stdio;int[99]a;int*p,q,r;int f(int d){int b=0;for(r=q;r>&*a&(r+=d)<p&&*r<*q;)b|=*r+9<*q;return b;}void main(){for(p=q=&*a;~scanf("%d",p);)p++;for(;q<p;)writefln(*q++,f(1)*f(-1)?"*":"");}

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

download

return to the top page