Peak Detection by uru

label 1,2,9;var a:array[byte]of word;i,j,k,l,m,t,x:comp;begin
repeat inc(i);read(a[i])until eof;for j:=1to i do begin
m:=0;x:=a[j];for k:=j+1to i do if x-a[k]>9then goto 1;goto 9;1:for l:=j-1downto 1do
if x-a[l]>9then goto 2;goto 9;2:m:=1;for t:=l to k do if a[t]>x then m:=0;9:writeln(x,'*':m)end end.

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

download

return to the top page