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",&samples[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[pos]/2.0)
- {
- results[ans] = pos;
- ans++;
- break;
- }
- printf("%d\n",ans);
- for (int i=0; i<ans; i++) printf("%d\n",results[i]+1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement