简单题
View Code
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
using namespace std;
#define maxn 50005
int n;
int f[maxn];
int main()
{
//freopen("t.txt", "r", stdin);
scanf("%d", &n);
for (int i = 0; i < n; i++)
scanf("%d", &f[i]);
if (n == 1)
{
printf("1\n");
return 0;
}
if (f[0] >= f[1])
printf("1\n");
for (int i = 1; i < n - 1; i++)
if (f[i] >= f[i - 1] && f[i] >= f[i + 1])
printf("%d\n", i + 1);
if (f[n - 1] >= f[n - 2])
printf("%d\n", n);
putchar('\n');
return 0;
}