Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- int samples[10005], n, results[10005], ans=0;
- int main()
- {
- freopen("seti.in","r",stdin);
- freopen("seti.out","w",stdout);
- scanf("%d",&n);
- for (int i=0; i<n; i++) scanf("%d",&sample[i]);
- for (int pos=0; pos<n; pos++)
- for (int i=1; pos-i>=0 && pos+i<n; i++)
- if (samples[pos-i]==samples[pos+i] && samples[pos-i]<samples[i]/2.0)
- {
- results[ans] = pos;
- ans++;
- }
- printf("%d\n",ans);
- for (int i=0; i<results; i++) printf("%d\n",results[i]);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement