inline bool kadomatu(int a,int b,int c){ return a!=b&&b!=c&&c!=a&&((ab && c>b)); } { int i,n,a[1000],c=0; rd(n);rd(a(n)); rep(i,0,n-2){ c+=kadomatu(a[i],a[i+1],a[i+2]); } wt(c); }